Make your "Game Over" screen... for example here I used the 254th one:
In "Project Settings > User Constants", create a new constants named "GAME_OVER_SCREEN", and give it the value of the screen you chose, here "254":
Now, modify your PlayerLoseLife.asm script, like
This :
Code:
;;; do loss of life stuff here
DEC myLives
LDA myLives
BNE gameNotOver
;;do gameover stuff here. Warp to screen? Show animation? Just restart?
;JMP RESET
LDA #GAME_OVER_SCREEN
STA continueScreen
LDA #$02
STA temp1
JMP isGameOver
gameNotOver:
LDA #$04
STA temp1
isGameOver:
;;;;;
;;; do warp to continue screen stuff here.
LDA #$00
STA newGameState
LDA continueMap
CLC
ADC #$01
STA temp
GoToScreen continueScreen, temp, temp1
LDA #$00
STA playerToSpawn
;LDX player1_object
;DeactivateCurrentObject
LDA #$01
STA loadObjectFlag
JSR DeactivateAllObjects
LDA continuePositionX
STA newX
LDA continuePositionY
STA newY
;; player1 reset health:
LDA #$03 ;; <--- HERE reset with your Health value
STA myHealth
And another things, here a script to RESET your game when you are on the Game Over screen:
Code:
;; if on the GAME OVER screen
LDA currentScreen
CLC
CMP #GAME_OVER_SCREEN
BNE +
JMP RESET
+
RTS
You can assign this script to any button you want to use to reset the game.