Ooh, I like this! I'm gonna give that a go, thanks!Is it possible to change the way of thinking, for example, check myLives after restart (TimerEndScripts.asm) and execute action step 06 if it is 0?
TXA
PHA
LDA gameState
BEQ +continue
JMP +skipHurt
+continue:
LDA gameHandler
AND #%10000000
BEQ +canHurtPlayer
JMP +skipHurt
+canHurtPlayer:
TXA
STA temp
GetActionStep temp
CMP #$07
BNE +canHurtPlayer
JMP +skipHurt
+canHurtPlayer
GetActionStep temp
CMP #$06
BNE +PsHurt
JMP +skipHurt
+PsHurt
DEC myLives
PlaySong #song_index_MISSBGM
UpdateHudElement #$01
LDA myLives
BNE +notZeroLives
;;;zero lives
ChangeActionStep player1_object, #$06
;; recoil
LDA #$00
STA Object_h_speed_hi,x
STA Object_h_speed_lo,x
STA Object_v_speed_hi,x
STA Object_v_speed_lo,x
; LDA xPrev
; STA Object_x_hi,x
; LDA yPrev
; STA Object_y_hi,x
StopMoving temp, #$FF, #$00
;;WarpToScreen warpToMap, #$47, #$01
;;JMP RESET
;;RTS
LDA #$FF
STA gameState
JMP +skipHurt
+notZeroLives
ChangeActionStep player1_object, #$07
;; recoil
LDA #$00
STA Object_h_speed_hi,x
STA Object_h_speed_lo,x
STA Object_v_speed_hi,x
STA Object_v_speed_lo,x
; LDA xPrev
; STA Object_x_hi,x
; LDA yPrev
; STA Object_y_hi,x
StopMoving temp, #$FF, #$00
+skipHurt
PLA
TAX
YOU ARE MY HERO!! That worked!! OMG thank you so much!! That approach makes perfect sense.I tested with that script (for the handle player hurt), and it seems to work correctly:
Code:TXA PHA LDA gameState BEQ +continue JMP +skipHurt +continue: LDA gameHandler AND #%10000000 BEQ +canHurtPlayer JMP +skipHurt +canHurtPlayer: TXA STA temp GetActionStep temp CMP #$07 BNE +canHurtPlayer JMP +skipHurt +canHurtPlayer GetActionStep temp CMP #$06 BNE +PsHurt JMP +skipHurt +PsHurt DEC myLives PlaySong #song_index_MISSBGM UpdateHudElement #$01 LDA myLives BNE +notZeroLives ;;;zero lives ChangeActionStep player1_object, #$06 ;; recoil LDA #$00 STA Object_h_speed_hi,x STA Object_h_speed_lo,x STA Object_v_speed_hi,x STA Object_v_speed_lo,x ; LDA xPrev ; STA Object_x_hi,x ; LDA yPrev ; STA Object_y_hi,x StopMoving temp, #$FF, #$00 ;;WarpToScreen warpToMap, #$47, #$01 ;;JMP RESET ;;RTS LDA #$FF STA gameState JMP +skipHurt +notZeroLives ChangeActionStep player1_object, #$07 ;; recoil LDA #$00 STA Object_h_speed_hi,x STA Object_h_speed_lo,x STA Object_v_speed_hi,x STA Object_v_speed_lo,x ; LDA xPrev ; STA Object_x_hi,x ; LDA yPrev ; STA Object_y_hi,x StopMoving temp, #$FF, #$00 +skipHurt PLA TAX
That's so cool! Your son must've been on cloud 9 when that released!! Amazing parenting I have a couple of my kids smaller projects on my site but nothing that got printed to cartridge like that!Glad the script worked for you, @Holmfry
Thank you, yes, KUBO 3 is my son's game, I helped him for the code (like I did for some other nesmaker projects).