playerDeath:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
LDX #TOTAL_MAX_OBJECTS
LDA #0
-
CPX player1_object
BEQ +skipMe
STA Object_x_hi,x
DestroyObject
+skipMe
;; etc
DEX
BPL -
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
StopSound
PlaySound #sfx_Lose
;; STOP the scrolling V2
LDA scrollByte
AND #%11111101
STA scrollByte
LDA ScreenFlags00
ORA #%00110000
STA ScreenFlags00
LDA #$00
STA Object_h_speed_lo,x
STA Object_h_speed_hi,x
STA Object_v_speed_lo,x
STA Object_v_speed_hi,x
LDA Object_direction,x
AND #%00000111
STA Object_direction,x
ChangeActionStep player1_object, #$06
Dec myLives
LDA myLives
BEQ +livesZero
JMP +livesNotZero
+livesZero
LDA #%11000010
LDA #$FE ;; the screen number you want to warp to
STA warpToScreen
LDA #$00 ;; the map to warp to (0:overworld / 1:underworld)
STA warpMap
WarpToScreen warpMap, warpToScreen, #$01
LDA #$FE
STA gameState
+livesNotZero
RTS