4.1.5 - How do I implement continues on the gameover screen in Simple Plataform Module?

Saulus_Lira

Member
Good afternoon everyone.
This forum has been my second home :lol: (lol)
I would like to know how do I implement Continues Limited on the GameOver screen (about 3 continues, more or less).
This GameOver screen I use the one created by Dale_Coop (master Dale :cool: ), using one of my blank blocks to obtain it.
In this, I would like my character to return to a specific screen, but with all my powerUps already acquired in the game, and default lives (5, in this case).
It is possible?
I thank you for your help.
 

mouse spirit

Well-known member
So i would say, make a continues variable just like health n stuff . Say when lives gone ,do i have continues. (pretty much how health and lives work together,maybe hijack that code)IF no,just game over, if yes,decrease one continue and when at gameoverscreen show option to continue.When yes, also fill lives back up and just dont reset.
After that id say just go to last checkpoint or something. Could make different game over screen for each area and a specific warp out for each one, and warp after continue is selected.

Thats the outline im guessing you want to follow.Just for starters.. I cant be certain about all this but i would say basically .


Vague example.
Code:
LDA Object_lives,x
CMP #$00 ;;compare to 0
BNE++ ;;if not 0 ; skipsome of the next code down to ++

;;If 0 ,Now Do this

LDA Object_continues,x
CMP #$00 
BEQ++
	SEC
	SBC #$01 ;; subtract 1 continue
	
	;;Now do warp code or press start code and stuff
	;;;;;;;;
	;;;;;
	;;;;;;
	;;;;;;
	;;;;;;;;;
	
	++
 

Saulus_Lira

Member
Right.
May i use the var huds for counts, or create a new userVar? (Maybe this two mods shold works)
I´ll try implement this on game over screen code just i have, and see what happens.
 

mouse spirit

Well-known member
Probly either way. If you dont care to display continues in the hud, maybe just use a user variable that way. Hud vars are more involved i think.Ill try to find a link that may help.
I found a topic youve already read... i will look further.
 

dale_coop

Moderator
Staff member
Continues is a great idea :)
As mouse spirit says, you could use a user variable "continues" (or "myContinues" or anything you want) with your initial value of "3" for example... then you could check that variable to know if you need to do the RESET or another warpToScreen.

the code to check myContinues... this code should be on the input script used (to reset or not) on the GameOver screen:
Code:
	LDA myContinues
	BEQ noMoreContinues
			
			;; still have continues, so we decrease it:
			DEC myContinues
			
			;; and we warp code (I copied/pasted the game over one):
			LDA #$00
			STA newGameState
			LDA continueMap
			CLC
			ADC #$01
			STA temp
			GoToScreen continueScreen, temp, #$04    
			LDA #$00
			STA playerToSpawn
			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

			JMP endCheckingContinues
noMoreContinues:
			JM RESET
endCheckingContinues:
		RTS


But, what if the user doesn't want to continue? if he wants to reset (to play differently, or better score or...)...hmm...

Maybe a better approach for the game would be to have the possibility to get more lives (pickups?)
 

Saulus_Lira

Member
dale_coop said:
Continues is a great idea :)
As mouse spirit says, you could use a user variable "continues" (or "myContinues" or anything you want) with your initial value of "3" for example... then you could check that variable to know if you need to do the RESET or another warpToScreen.

the code to check myContinues... this code should be on the input script used (to reset or not) on the GameOver screen:
Code:
	LDA myContinues
	BEQ noMoreContinues
			
			;; still have continues, so we decrease it:
			DEC myContinues
			
			;; and we warp code (I copied/pasted the game over one):
			LDA #$00
			STA newGameState
			LDA continueMap
			CLC
			ADC #$01
			STA temp
			GoToScreen continueScreen, temp, #$04    
			LDA #$00
			STA playerToSpawn
			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

			JMP endCheckingContinues
noMoreContinues:
			JM RESET
endCheckingContinues:
		RTS


But, what if the user doesn't want to continue? if he wants to reset (to play differently, or better score or...)...hmm...

Maybe a better approach for the game would be to have the possibility to get more lives (pickups?)


Great!!! I did something similar with Game Over Screen Resets, and i named it to GameOverContinues.asm for imputs, but with a HUD variable. I will try with a Variable user.
At the end of the code I reset my Lives by default, like my Health.

Code:
              ;; player1 reset health:
			LDA #$06        ;;  <--- HERE reset with your Health value. 6 in my case.
			STA myHealth
			;; player1 reset lives:
			LDA #$05        ;;  <--- HERE reset with your Lives value. 5 in my case.
			STA myLives
 

dale_coop

Moderator
Staff member
Perfect, yeah, you can totally use a HUD variable too. It should also work.


(HUD variables are specific variables because there are meant to be displayed on the hud area... the very specific about HUD variables is who the variable is displayed as a number, because in that case the hud variable is actually split into several memory variables, one for each digit that is displayed... for example for myScore displayed as 8 digits, there will be 8 variables myScore to access the first one, myScore+1 for the 2nd, myScore+2 for the 3rd... and myScore+7 for the last one... and each variable will have a value between "0" and "9")
 
Top Bottom