So this code in platform module handles how the monster is killed upon being stomped:
It works and isn't buggy at all (as far as I've noticed), but I want it to observe monster health and hurt them instead of killing them instantly. Anyone knows what changes I have to make to this code to make it work? For anyone interested it's part of handle object collision script for platform module, starts on line 176
Code:
LDX player1_object
;TXA
;STA tempx
;JMP playerWasHurtDuringCollision
;LDX player1_object
LDA selfCenterY
CMP otherCenterY
BCS dontJumpOnMonster
;;; JUMP ON MONSTER
LDX player1_object
LDA #$00
SEC
SBC #$04
STA Object_v_speed_hi,x
LDX tempx
DeactivateCurrentObject
LDY tempy
;; INCREASE SCORE
AddValue #$06, myScore, #$01, #$00
;;;constant how many places, what variable, how much to change (0-9), what place to change (0=ones, 1=tens, etc etc etc)
;;;;
LDA DrawHudBytes
ora #HUD_myScore
STA DrawHudBytes
It works and isn't buggy at all (as far as I've noticed), but I want it to observe monster health and hurt them instead of killing them instantly. Anyone knows what changes I have to make to this code to make it work? For anyone interested it's part of handle object collision script for platform module, starts on line 176