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.lab
dino.lst dino.lst
*.bak
+40 -1
View File
@@ -47,7 +47,12 @@ screen
.ds $100*SCR_HEIGHT .ds $100*SCR_HEIGHT
; display list ; display list
GameDL 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, # .rept SCR_HEIGHT, #
.byte MODE2+LMS+SCH ; gr.0+LMS+HSCRL .byte MODE2+LMS+SCH ; gr.0+LMS+HSCRL
@@ -56,6 +61,9 @@ line:1_addr
.endr .endr
.byte JVB .byte JVB
.word GameDL .word GameDL
status_line
dta d" l-hi 00000 r-hi 00000 00000 "
score=status_line+33
;--------------------------------------------------- ;---------------------------------------------------
; World table without dino ; World table without dino
WorldTable WorldTable
@@ -173,6 +181,7 @@ NothingToDraw
.endp .endp
;----------------------------------------------- ;-----------------------------------------------
.proc WorldShift .proc WorldShift
jsr ScoreUp
ldy #0 ldy #0
Shift Shift
lda WorldTable+1,y lda WorldTable+1,y
@@ -217,6 +226,36 @@ noInsert
rts rts
.endp .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 .proc Animate
ldy #WORLD_LENGTH ldy #WORLD_LENGTH
@ lda WorldTable,y @ lda WorldTable,y
+52 -33
View File
@@ -47,7 +47,12 @@ screen
.ds $100*SCR_HEIGHT .ds $100*SCR_HEIGHT
; display list ; display list
GameDL 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, # .rept SCR_HEIGHT, #
.byte MODE2+LMS+SCH ; gr.0+LMS+HSCRL .byte MODE2+LMS+SCH ; gr.0+LMS+HSCRL
@@ -56,6 +61,9 @@ line:1_addr
.endr .endr
.byte JVB .byte JVB
.word GameDL .word GameDL
status_line
dta d" l-hi 00000 r-hi 00000 00000 "
score=status_line+33
;--------------------------------------------------- ;---------------------------------------------------
; World table without dino ; World table without dino
WorldTable WorldTable
@@ -64,35 +72,9 @@ WorldTable
FirstSTART FirstSTART
jsr GenerateCharsets jsr GenerateCharsets
jsr SetGameScreen jsr SetGameScreen
jsr SetStart jsr FadeColors
NewGame
; test only (some object in the world) jsr SetStart
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
EndLoop EndLoop
;lda #$32 ;lda #$32
;sta COLBAK ;sta COLBAK
@@ -127,7 +109,8 @@ EndLoop
mva #4 hscrol mva #4 hscrol
jmp EndLoop jmp EndLoop
EndGame EndGame
halt key
jmp NewGame
rts rts
;----------------------------------------------- ;-----------------------------------------------
@@ -198,6 +181,7 @@ NothingToDraw
.endp .endp
;----------------------------------------------- ;-----------------------------------------------
.proc WorldShift .proc WorldShift
jsr ScoreUp
ldy #0 ldy #0
Shift Shift
lda WorldTable+1,y lda WorldTable+1,y
@@ -242,6 +226,36 @@ noInsert
rts rts
.endp .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 .proc Animate
ldy #WORLD_LENGTH ldy #WORLD_LENGTH
@ lda WorldTable,y @ lda WorldTable,y
@@ -568,10 +582,15 @@ Down
jsr ClearWorld jsr ClearWorld
lda #0 lda #0
sta DinoWalkPhase sta DinoWalkPhase
lda #0
sta DinoState sta DinoState
sta COLOR1 sta diff_level
sta Hit
rts
.endp
;-----------------------------------------------
.proc FadeColors
ldy #0 ldy #0
sty COLOR1
FadeColor FadeColor
sty COLOR2 sty COLOR2
sty COLOR4 sty COLOR4
BIN
View File
Binary file not shown.