TheRetroBro
Active member
So I've checked out the death animation thread by Dale and my original code is so different I don't know where to start.
Im.using the lr platformer module and when my player is it once he does and respawns at last warp or checkpoint (which is fine this is what I want). I created a death animation and assigned it to action step 6.
However my problem appears that wherever I put my "creat action step macro" in my code. The action steps appears AFTER my player reloads (not when I take damage)
So my player will get hit. Respawn then play the death animation. I'm at my wits end here. Please help.
Im.using the lr platformer module and when my player is it once he does and respawns at last warp or checkpoint (which is fine this is what I want). I created a death animation and assigned it to action step 6.
However my problem appears that wherever I put my "creat action step macro" in my code. The action steps appears AFTER my player reloads (not when I take damage)
So my player will get hit. Respawn then play the death animation. I'm at my wits end here. Please help.
Code:
;;;;;;;;;;;;;;;;;; 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.
; Check if there's an enemy below (assuming enemies have a specific object type).
LDA Object_type, x
CMP #$06 ;; Adjust the object type accordingly.
BNE +doHurtPlayer ;; If the object below is not an enemy, proceed to hurting the player.
TXA
PHA
LDX otherObject
DestroyObject
CountObjects #%00001000
BNE +notZeroCount
LDA scrollByte
ORA #%00000010
STA scrollByte
;;; if there are no more monsters left, we want to disable
;;; the edge check for scrolling.
LDA ScreenFlags00
AND #%11101111
STA ScreenFlags00
+notZeroCount
PLA
TAX
;; Do a hop
LDA #$FC
STA Object_v_speed_hi, x
JMP +skipHurt
+doHurtPlayer
PlaySound #sfx_index_sfx_laser
Dec myLives
LDA myLives
BNE myLivesNotZero
JMP RESET
;; game over.
;;WarpToScreen #$0, #01, #$01;;;; also could warp to game over screen here instead.
myLivesNotZero:
ChangeActionStep player1_object, #$06 ;;; If I insert here it plays on reload
LDA continueMap
STA warpMap
LDA continueX
STA newX
LDA continueY
STA newY
LDA continueScreen
STA warpToScreen
STA camScreen
WarpToScreen warpToMap, warpToScreen, #$02
+skipHurt