The checkpoint type tile manages to, if activated, to save the player progression until he looses all his lives. To activate a checkpoint the checkpoint tile, just walk on it.
Available in the beta, the checkpoint type tile is not in the adventure module... So this is how to bring back this functionality:
First, we need to add PlayerLives to the game. Because user variables are not yet implemented in the tool (except the hud ones, but too few variables there to be wasted), we need to declare the variable in the "GameEngineData\Routines\Variables\SystemVariables.asm" script, add this line at the end:
Then, open the "GameEngineData\Routines\InitializationScripts\initLoads.asm" script to set the initial value of your player lives:
And modify the "GameEngineData\Routines\UserScripts\AdventureGame_Base\HurtWinLoseDeath\Adventure_PlayerLoseLife.asm" script:
Now add the following "Checkpoint.asm" script in the "GameEngineData\Routines\UserScripts\AdventureGame_Base\TileScripts" folder:
Lastly, in the "Project Settings > Project Labels", rename for exemple the unused Tile Types "Tile 09" to "9 - CheckPoint", then in "Project Settings > Scripts Settings" assign the "Checkpoint.asm" script to "Tile Collision 09".
Voilà, now you can make Checkpoint type tiles! When the player is dead, he starts again from that checkpoint (until he looses his 3 lives)
Available in the beta, the checkpoint type tile is not in the adventure module... So this is how to bring back this functionality:
First, we need to add PlayerLives to the game. Because user variables are not yet implemented in the tool (except the hud ones, but too few variables there to be wasted), we need to declare the variable in the "GameEngineData\Routines\Variables\SystemVariables.asm" script, add this line at the end:
Code:
playerLives .dsb 1 ;; player lives
Then, open the "GameEngineData\Routines\InitializationScripts\initLoads.asm" script to set the initial value of your player lives:
Code:
;;; delete me
;;; SET UP INITIAL VARIABLE VALUE HERE:
LDA #$03 ;; <<-- 3 LIVES
STA playerLives ;; player lives
And modify the "GameEngineData\Routines\UserScripts\AdventureGame_Base\HurtWinLoseDeath\Adventure_PlayerLoseLife.asm" script:
Code:
;; JMP RESET
;; loose player lives
LDA playerLives
SEC
SBC #$01
BEQ noMoreLives
STA playerLives
LDA #STATE_START_GAME
STA change_state
JMP doneWithLoseLife
noMoreLives:
JMP RESET
doneWithLoseLife:
Now add the following "Checkpoint.asm" script in the "GameEngineData\Routines\UserScripts\AdventureGame_Base\TileScripts" folder:
Code:
;; checkpoint
LDA Object_type,x
BNE nevermindSettingContinue
LDA currentScreen
STA continueScreen
LDA Object_x_hi,x
STA continuePositionX
LDA Object_y_hi,x
STA continuePositionY
;;PlaySound #sfx_pick
nevermindSettingContinue:
Lastly, in the "Project Settings > Project Labels", rename for exemple the unused Tile Types "Tile 09" to "9 - CheckPoint", then in "Project Settings > Scripts Settings" assign the "Checkpoint.asm" script to "Tile Collision 09".
Voilà, now you can make Checkpoint type tiles! When the player is dead, he starts again from that checkpoint (until he looses his 3 lives)