Added lives remaining display; reduced score display to 5 digits & lowered scoring values to more like a 1980 game

This commit is contained in:
Rob McMullen 2017-07-22 08:46:09 -07:00
parent 62976be9e8
commit 552ee3b894
4 changed files with 51 additions and 6 deletions

View File

@ -3,6 +3,7 @@ level_speed_l .byte 255, 200, 210, 220, 230, 240 ;# increment of fractional pixe
level_speed_h .byte 2, 2, 2, 2, 2, 2
;level_speed_h .byte 0, 0, 0, 0, 0, 0
player_score_row .byte 2, 7, 12, 17
player_lives_row .byte 3, 8, 13, 18
player_score_l .byte 0, 0, 0, 0
player_score_m .byte 0, 0, 0, 0
player_score_h .byte 0, 0, 0, 0
@ -112,8 +113,8 @@ GAME_OVER = 255
;
;# Scores
;
DOT_SCORE = $05
box_score .byte 0, $40, $80, $120, $160, $200, $240
DOT_SCORE = $01
box_score .byte 0, $20, $40, $60, $80, $100, $120
add_score nop
sed

View File

@ -200,9 +200,11 @@ init_panel nop
bne ?3
?4
ldx #0
jsr update_score
jsr print_score
jsr print_lives
inx
jsr update_score
jsr print_score
jsr print_lives
rts
player1_text .byte "PLAYER1", 0
@ -221,6 +223,39 @@ player2_text .byte "PLAYER2", 0
; c = " "
; pad.addch(row, col, ord(c))
; i += 1
update_lives nop
lda #MAZE_SCORE_COL
sta c
lda player_lives_row,x
sta r
lda #6
sta size
jsr damage_string
print_lives nop
ldy player_lives_row,x
jsr mazerow
lda player_lives,x
cmp #6
bcc ?ok
lda #6
?ok sta scratch_col
lda #40
sec
sbc scratch_col
sta scratch_col
ldy #MAZE_SCORE_COL
?loop cpy scratch_col
bcc ?blank
lda #'*'
bne ?show
?blank lda #0
?show sta (mazeaddr),y
iny
cpy #40
bcc ?loop
rts
print_hex pha
stx param_x
@ -241,6 +276,15 @@ print_hex pha
ldx param_x
rts
print_low_nibble stx param_x
and #$0f
tax
lda hexdigit,x
sta (mazeaddr),y
iny
ldx param_x
rts
; def update_score():
update_score nop
@ -257,7 +301,7 @@ print_score nop
jsr mazerow
ldy #MAZE_SCORE_COL
lda player_score_h,x
jsr print_hex
jsr print_low_nibble
lda player_score_m,x
jsr print_hex
lda player_score_l,x

Binary file not shown.

2
maze.s
View File

@ -54,7 +54,7 @@ SCREEN_ROWS = 24
MAZE_LEFT_COL = 1
MAZE_RIGHT_COL = 31
MAZE_PANEL_COL = 33
MAZE_SCORE_COL = 34
MAZE_SCORE_COL = 35 ; 5 digits for score
SCREEN_COLS = 40
;# Orbiter goes around the outside border, but not through the maze