4.1 Adventure Checkpoint

Having trouble compiling code? Getting an unexpected error? Player not appearing on screen? Seeking answers on how to do a particular thing? This is the forum you're looking for, to ask other NESmaker users for assistance.
User avatar
rimoJO
Posts: 246
Joined: Sat Jan 12, 2019 2:23 am
Location: Planet Earth

Re: 4.1 Adventure Checkpoint

Post by rimoJO » Sun May 19, 2019 6:45 pm

...oh. ._.

Code: Select all

    JMP RESET
Mystery Game status: Currently at least one in development. Stay tuned!
User avatar
dale_coop
Posts: 4206
Joined: Fri Feb 16, 2018 7:05 am
Location: France

Re: 4.1 Adventure Checkpoint

Post by dale_coop » Sun May 19, 2019 9:05 pm

Replace this script with this one:

Code: Select all

;;; 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	
-----
Sorry about my poor english
All I need: A Damn Fine Cup of Coffee
My games: PRESS START GAME / UNDERGROUND ADVENTURE / UNDERGROUND ADVENTURE (Arcade version - Byte-Off-2019)
User avatar
rimoJO
Posts: 246
Joined: Sat Jan 12, 2019 2:23 am
Location: Planet Earth

Re: 4.1 Adventure Checkpoint

Post by rimoJO » Mon May 20, 2019 12:23 pm

Thanks! ^w^
Mystery Game status: Currently at least one in development. Stay tuned!
KoolDoob
Posts: 49
Joined: Wed Sep 11, 2019 5:55 pm
Location: France

Re: 4.1 Adventure Checkpoint

Post by KoolDoob » Tue Sep 17, 2019 10:45 am

I followed your tutorial Dale but I have an error during "Export and Test"
Attachments
Player Lose Life.PNG
Player Lose Life.PNG (27.57 KiB) Viewed 252 times
Export and Test issues because of the checkpoint.PNG
Export and Test issues because of the checkpoint.PNG (19.78 KiB) Viewed 252 times
KoolDoob
Posts: 49
Joined: Wed Sep 11, 2019 5:55 pm
Location: France

Re: 4.1 Adventure Checkpoint

Post by KoolDoob » Tue Sep 17, 2019 10:49 am

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.
User avatar
dale_coop
Posts: 4206
Joined: Fri Feb 16, 2018 7:05 am
Location: France

Re: 4.1 Adventure Checkpoint

Post by dale_coop » Tue Sep 17, 2019 12:59 pm

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.
-----
Sorry about my poor english
All I need: A Damn Fine Cup of Coffee
My games: PRESS START GAME / UNDERGROUND ADVENTURE / UNDERGROUND ADVENTURE (Arcade version - Byte-Off-2019)
Post Reply