Score added

This commit is contained in:
Pecusx
2024-08-12 10:00:05 +02:00
parent 842f68c8a7
commit f8b89e4bc8
4 changed files with 93 additions and 34 deletions
+1
View File
@@ -1,3 +1,4 @@
dino.lab
dino.lst
*.bak
+40 -1
View File
@@ -47,7 +47,12 @@ screen
.ds $100*SCR_HEIGHT
; display list
GameDL
:15 .byte SKIP8 ; empty lines
:13 .byte SKIP8 ; empty lines
.byte MODE2+LMS ; gr.8+LMS
.word status_line
.byte SKIP8 ; empty lines
.rept SCR_HEIGHT, #
.byte MODE2+LMS+SCH ; gr.0+LMS+HSCRL
@@ -56,6 +61,9 @@ line:1_addr
.endr
.byte JVB
.word GameDL
status_line
dta d" l-hi 00000 r-hi 00000 00000 "
score=status_line+33
;---------------------------------------------------
; World table without dino
WorldTable
@@ -173,6 +181,7 @@ NothingToDraw
.endp
;-----------------------------------------------
.proc WorldShift
jsr ScoreUp
ldy #0
Shift
lda WorldTable+1,y
@@ -217,6 +226,36 @@ noInsert
rts
.endp
;-----------------------------------------------
.proc ScoreUp
inc score+4
lda score+4
cmp #$1a ; 9+1 character code
bne ScoreReady
lda #$10 ; 0 character code
sta score+4
inc score+3
lda score+3
cmp #$1a ; 9+1 character code
bne ScoreReady
lda #$10 ; 0 character code
sta score+3
inc score+2
lda score+2
cmp #$1a ; 9+1 character code
bne ScoreReady
lda #$10 ; 0 character code
sta score+2
inc score+1
lda score+1
cmp #$1a ; 9+1 character code
bne ScoreReady
lda #$10 ; 0 character code
sta score+1
inc score
ScoreReady
rts
.endp
;-----------------------------------------------
.proc Animate
ldy #WORLD_LENGTH
@ lda WorldTable,y
+52 -33
View File
@@ -47,7 +47,12 @@ screen
.ds $100*SCR_HEIGHT
; display list
GameDL
:15 .byte SKIP8 ; empty lines
:13 .byte SKIP8 ; empty lines
.byte MODE2+LMS ; gr.8+LMS
.word status_line
.byte SKIP8 ; empty lines
.rept SCR_HEIGHT, #
.byte MODE2+LMS+SCH ; gr.0+LMS+HSCRL
@@ -56,6 +61,9 @@ line:1_addr
.endr
.byte JVB
.word GameDL
status_line
dta d" l-hi 00000 r-hi 00000 00000 "
score=status_line+33
;---------------------------------------------------
; World table without dino
WorldTable
@@ -64,35 +72,9 @@ WorldTable
FirstSTART
jsr GenerateCharsets
jsr SetGameScreen
jsr SetStart
; test only (some object in the world)
lda #1 ;bird0
sta WorldTable+10
lda #4 ;cactus
sta WorldTable+20
lda #4+$80 ; cactus (second char)
sta WorldTable+21
;
ldx #5 ; position
ldy #0 ; shape
jsr ShowDino
ldx #10 ; position
ldy #1 ; shape
jsr ShowDino
ldx #15 ; position
ldy #2 ; shape
jsr ShowDino
ldx #20 ; position
ldy #3 ; shape
jsr ShowDino
ldx #25 ; position
ldy #4 ; shape
jsr ShowDino
mva #$50 screen+$700+32
mva #0 diff_level
sta Hit
jsr FadeColors
NewGame
jsr SetStart
EndLoop
;lda #$32
;sta COLBAK
@@ -127,7 +109,8 @@ EndLoop
mva #4 hscrol
jmp EndLoop
EndGame
halt
key
jmp NewGame
rts
;-----------------------------------------------
@@ -198,6 +181,7 @@ NothingToDraw
.endp
;-----------------------------------------------
.proc WorldShift
jsr ScoreUp
ldy #0
Shift
lda WorldTable+1,y
@@ -242,6 +226,36 @@ noInsert
rts
.endp
;-----------------------------------------------
.proc ScoreUp
inc score+4
lda score+4
cmp #$3a ; 9+1 character code
bne ScoreReady
lda #$30 ; 0 character code
sta score+4
inc score+3
lda score+3
cmp #$3a ; 9+1 character code
bne ScoreReady
lda #$30 ; 0 character code
sta score+3
inc score+2
lda score+2
cmp #$3a ; 9+1 character code
bne ScoreReady
lda #$30 ; 0 character code
sta score+2
inc score+1
lda score+1
cmp #$3a ; 9+1 character code
bne ScoreReady
lda #$30 ; 0 character code
sta score+1
inc score
ScoreReady
rts
.endp
;-----------------------------------------------
.proc Animate
ldy #WORLD_LENGTH
@ lda WorldTable,y
@@ -568,10 +582,15 @@ Down
jsr ClearWorld
lda #0
sta DinoWalkPhase
lda #0
sta DinoState
sta COLOR1
sta diff_level
sta Hit
rts
.endp
;-----------------------------------------------
.proc FadeColors
ldy #0
sty COLOR1
FadeColor
sty COLOR2
sty COLOR4
BIN
View File
Binary file not shown.