Bucket Mouse
Active member
myLives is the name of the variable, and it's already in the game, coded and everything. All I should have to do is set up that variable in the HUD, which I have done. But the number of lives did not tick down.
I dug into the code and, weirdly, though the content of playerloselife.asm is present elsewhere, it's not included in the ASM that gets loaded into the ROM. Instead, there's an alternate script that simply says "JMP RESET."
So I copy-pasted playerloselife.asm into that script. Now the HUD registers a lost life, but everything else is broken: the player sprite does not appear and 3/4 of the monsters don't move. I have no idea where to go from there. Below is the ASM for playerloselife; do you see anything curious?
Also, I'd like to add a level counter that tells you what level you're on (this is a single screen game with one level per screen). How do I set that up?
I dug into the code and, weirdly, though the content of playerloselife.asm is present elsewhere, it's not included in the ASM that gets loaded into the ROM. Instead, there's an alternate script that simply says "JMP RESET."
So I copy-pasted playerloselife.asm into that script. Now the HUD registers a lost life, but everything else is broken: the player sprite does not appear and 3/4 of the monsters don't move. I have no idea where to go from there. Below is the ASM for playerloselife; do you see anything curious?
Also, I'd like to add a level counter that tells you what level you're on (this is a single screen game with one level per screen). How do I set that up?
Code:
;;; do loss of life stuff here
DEC myLives
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
LDA continuePositionX
STA newX
LDA continuePositionY
STA newY