;;;;;;;;;;;;;;;;;; Presumes there is a variable called myLives defined in user variables.
;;;;;;;;;;;;;;;;;; You could also create your own variable for this.
LDA gameHandler
AND #%10000000
BEQ +canHurtPlayer
JMP +skipHurt
+canHurtPlayer:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;; is the monster below our feet?
;;;;;;;;;; and are we moving downward?
LDA Object_v_speed_hi,x
BEQ +doHurtPlayer ;; equal to zero
BMI +doHurtPlayer ;; or negative
;; here we are moving downward.
TXA
PHA
LDX otherObject
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Put jump on stuff here
; DestroyObject
JSR doHandleHurtMonster
PLA
TAX
;; Do a hop
LDA #$FC
STA Object_v_speed_hi,x