baardbi
Well-known member
Help!
I screwed up big time (and no I didn't make a backup...)
I was trying to change something when my player loses a life, but it didn't work. So then I tried to change something else, and that made it worse. So then I paniced and tried several things, and now the game just freezes when my player loses a life. I just want to get back the basic functionality:
- Create player death object
- Subtract a life
- Start at the start screen
I didn't change the scripts very much in the first place, so if there is an easy way to get back to default that would probably work.
Here is my Project Settings and the code for HandlePlayerDeath and PlayerLoseLife:
PS! I learned my lesson. From now on I will make backup a part of my development routine... :lol:
Project Settings:
HandlePlayerDeath.asm
PlayerLoseLife.asm
I screwed up big time (and no I didn't make a backup...)
I was trying to change something when my player loses a life, but it didn't work. So then I tried to change something else, and that made it worse. So then I paniced and tried several things, and now the game just freezes when my player loses a life. I just want to get back the basic functionality:
- Create player death object
- Subtract a life
- Start at the start screen
I didn't change the scripts very much in the first place, so if there is an easy way to get back to default that would probably work.
Here is my Project Settings and the code for HandlePlayerDeath and PlayerLoseLife:
PS! I learned my lesson. From now on I will make backup a part of my development routine... :lol:
Project Settings:
HandlePlayerDeath.asm
Code:
CPX player1_object
BNE +
JSR HandlePlayerDeath
PlaySound #SND_HURT_PLAYER
+
PlayerLoseLife.asm
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
LDA #GAME_OVER_SCREEN
STA continueScreen
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
;DeactivateCurrentObject
StopSound
;;;;;;;;;;;;;;;;;;;
;LDX player1_object
;LDA Object_x_hi,x
;STA temp
;LDA Object_y_hi,x
;STA temp1
;CreateObject temp, temp1, #$08, #$00, currentNametable
;; need to do this redundantly, otherwise, the death object will be in same slot as player
;PlaySound #SND_HURT_PLAYER
;;;;;;;;;;;;;;;;;;;
;PlaySound #$00, #$00
LDA #$FF
STA player1_object
LDX tempx
LDY tempy