4.1 Adventure Checkpoint

dale_coop

Moderator
Staff member
Replace this script with this one:
Code:
;;; do loss of life stuff here
	DEC myLives	;; <-- this line decreases the life... 
	LDA myLives
	BNE gameNotOver
	;;do gameover stuff here.  Warp to screen?  Show animation?  Just restart?
	JMP RESET
	
gameNotOver:
	;;;;;
	;;; do warp to continue screen stuff here.
	LDA #$00
	STA newGameState
	LDA continueMap
	CLC
	ADC #$01
	STA temp
	GoToScreen continueScreen, temp, #$04	
	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 player's Health value (for example, 3 for myHealth)
	STA myHealth
 

KoolDoob

Member
I followed your tutorial Dale but I have an error during "Export and Test"
 

Attachments

  • Export and Test issues because of the checkpoint.PNG
    Export and Test issues because of the checkpoint.PNG
    19.8 KB · Views: 2,573
  • Player Lose Life.PNG
    Player Lose Life.PNG
    27.6 KB · Views: 2,573

KoolDoob

Member
I removed the 6 first lines of the code and I can "Export and Test".

It seems I can activate the checkpoint by going trought but when I die nothing happen.
 

dale_coop

Moderator
Staff member
You need to add a myLives variable to your project (in "Project Settings > User variables") with a value of..."0" (for unlimited or "255" if you prefer). And it should work.
PS: another advice, don't remove block of code in the scripts, else it will not work as intended.... if you have error, it's just because there 's missing something (a constant/variable) in your project. Because all the modules don't have the same constants/variables declared by default.
 
Top Bottom