Lives problem

fcgamer

New member
As seen in the video, I tried to set the lives but it counts it as the player running out and then restarts the game.

Anyone have any idea what is not set properly, to cause this? Thanks!
 

dale_coop

Moderator
Staff member
Because HUD variables are split into different variables (for display 0-9).
In your case, it's a 2 digit HUD variable so it will be myLives (values from 0-9) from the units... and myLives+1 (values from 0-9) for the tenth.
It means when you want to check if no more lives (in the PlayerLoseLife.asm script), you will have to check both variables , first the tenth one, than the units one, like that:

Code:
playerLoseLife:
;;; do loss of life stuff here
	;DEC myLives
	SubtractValue #$02, myLives, #$01, #$00
	;; check the lives:
	LDA myLives+1
	BNE gameNotOver
	LDA myLives
	BNE gameNotOver
	;;do gameover stuff here.  Warp to screen?  Show animation?  Just restart?
	JMP RESET

gameNotOver:
	;; not game over, we continue...
 
Top Bottom