Added game over text

This commit is contained in:
Rob McMullen 2017-07-22 14:38:36 -07:00
parent c186a55b33
commit dc749cd1e6
2 changed files with 33 additions and 6 deletions

View File

@ -97,8 +97,9 @@ evaluate_status nop
sta actor_active,x
rts
?game_over nop
rts
?game_over ldx #$ff
txs
jmp check_restart
?alive lda #1
sta actor_active,x

34
main.s
View File

@ -142,10 +142,39 @@ start nop
;jsr clrscr
jsr init_once
jsr title_screen
restart jsr title_screen
jsr init_game
jsr game_loop
check_restart ldx #34
ldy player_score_row
lda #<game_text
sta scratch_ptr
lda #>game_text
sta scratch_ptr+1
jsr printstr
ldx #35
ldy player_lives_row
lda #<over_text
sta scratch_ptr
lda #>over_text
sta scratch_ptr+1
jsr printstr
jsr pageflip
lda KBDSTROBE
?1 lda KEYBOARD
bpl ?1
lda KBDSTROBE
jmp restart
game_text .byte "GAME ",0
over_text .byte "OVER",0
forever
jmp forever
init_once
jsr init_screen_once
jsr init_actors_once
@ -156,9 +185,6 @@ init_once
bne ?1
rts
forever
jmp forever
clrscr
lda #0
sta clr1+1