Change State for Checkpoint sends player to the wrong location after warp

JeffPack

New member
So I set up checkpoints in the adventure module and it works beautifully until I get to a certain screen. It took me forever to realize that what was different about this screen was that I had just come through a warp tile. I removed the warp tile and everything is fine. Turns out... if you die after warping, changing state sends you to the top left corner of continueScreen which triggers a screen transition and this is the result you get.
wacky.PNG


Not sure what's happening here but it seems that continueX and continueY are getting changed after you warp, because it works just fine until you warp.
For reference here is my lose life script
Code:
;; loose player lives
	LDA myLives
	CLC
	CMP #$00
	BEQ noMoreLives
	SEC 
	SBC #$01
	STA myLives
	
	LDA #$04
	STA myHealth
	
	LDA #STATE_START_GAME
	STA change_state

	JMP doneWithLoseLife
noMoreLives:
	JMP RESET
doneWithLoseLife:
 

JeffPack

New member
So the reason it was sending me to the top left of the screen is because apparently after warping, changing the state after dying uses the warp in location set on the continueScreen rather than continuePositionX and continuePositionY. Since the screen with my checkpoint didn't have a warp in location it was set to 0, 0 and therefore put the player in the top left of the screen.

Not sure where in the code it's getting messed up though. I guess I just have to make sure that all of my screens with checkpoints have a warp in location. But I would still consider this a bug.
 
Top Bottom