mirror of
https://github.com/Pecusx/dino-game.git
synced 2026-05-20 22:33:23 +02:00
Clouds added
This commit is contained in:
Binary file not shown.
@@ -144,6 +144,7 @@ ShapesTableH
|
|||||||
diff_object_gap ; min distance between obstacles by difficulty level
|
diff_object_gap ; min distance between obstacles by difficulty level
|
||||||
.by 18,17,15,13,11,9,8,7,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5
|
.by 18,17,15,13,11,9,8,7,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5
|
||||||
;----------vars----------
|
;----------vars----------
|
||||||
|
CloudHpos .by 0,0,0,0
|
||||||
diff_level .ds 1
|
diff_level .ds 1
|
||||||
DinoJumpTr .by 1,2,3,4,4,3,2,1
|
DinoJumpTr .by 1,2,3,4,4,3,2,1
|
||||||
JumpLen = 7
|
JumpLen = 7
|
||||||
|
|||||||
@@ -42,6 +42,8 @@ swap_table=$0600 ; table for swap bytes in left characters :)
|
|||||||
;---------------------------------------------------
|
;---------------------------------------------------
|
||||||
|
|
||||||
org $2000
|
org $2000
|
||||||
|
PMgraph
|
||||||
|
org PMGraph+$800 ; P/M graphics for clouds
|
||||||
;---------------------------------------------------
|
;---------------------------------------------------
|
||||||
; 4 charsets for fine scroll
|
; 4 charsets for fine scroll
|
||||||
font1
|
font1
|
||||||
@@ -54,13 +56,15 @@ font4 = font3+$400
|
|||||||
ins 'artwork/dino4.fnt' ; 4 charset
|
ins 'artwork/dino4.fnt' ; 4 charset
|
||||||
; display list
|
; display list
|
||||||
GameDL
|
GameDL
|
||||||
:13 .byte SKIP8 ; empty lines
|
:8 .byte SKIP8 ; empty lines
|
||||||
|
|
||||||
.byte MODE2+LMS ; gr.8+LMS
|
.byte MODE2+LMS ; gr.8+LMS
|
||||||
status_line_addr
|
status_line_addr
|
||||||
.word status_line_r
|
.word status_line_r
|
||||||
|
:4 .byte SKIP8
|
||||||
|
.byte MODE2
|
||||||
|
|
||||||
.byte SKIP8 ; empty lines
|
.byte SKIP8,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
|
||||||
@@ -70,15 +74,37 @@ line:1_addr
|
|||||||
.byte JVB
|
.byte JVB
|
||||||
.word GameDL
|
.word GameDL
|
||||||
status_line_r
|
status_line_r
|
||||||
dta d" l-hi 00000 r-hi 00000 00000 "
|
dta d" "
|
||||||
|
.byte $5d ; "N" letter
|
||||||
|
dta d"o internet! "
|
||||||
|
dta d" "
|
||||||
|
.byte $5e ; "L" letter
|
||||||
|
dta d"-"
|
||||||
|
.byte $7e,$7f ; "HI" letters
|
||||||
|
dta d" 00000 "
|
||||||
|
.byte $5f ; "R" letter
|
||||||
|
dta d"-"
|
||||||
|
.byte $7e,$7f ; "HI" letters
|
||||||
|
dta d" 00000 00000 "
|
||||||
status_line_l
|
status_line_l
|
||||||
dta d" 00000 00000 ih-r 00000 ih-l "
|
dta d" !tenretni o"
|
||||||
score=status_line_r+33
|
.byte $5d ; "N" letter
|
||||||
rhiscore=status_line_r+19
|
dta d" "
|
||||||
lhiscore=status_line_r+7
|
dta d" 00000 00000 "
|
||||||
scorel=status_line_l+2
|
.byte $7f,$7e ; "IH" letters
|
||||||
rhiscorel=status_line_l+16
|
dta d"-"
|
||||||
lhiscorel=status_line_l+28
|
.byte $5f ; "R" letter
|
||||||
|
dta d" 00000 "
|
||||||
|
.byte $7f,$7e ; "IH" letters
|
||||||
|
dta d"-"
|
||||||
|
.byte $5e ; "L" letter
|
||||||
|
dta d" "
|
||||||
|
score=status_line_r+33+40
|
||||||
|
rhiscore=status_line_r+19+40
|
||||||
|
lhiscore=status_line_r+7+40
|
||||||
|
scorel=status_line_l+2+40
|
||||||
|
rhiscorel=status_line_l+16+40
|
||||||
|
lhiscorel=status_line_l+28+40
|
||||||
;---------------------------------------------------
|
;---------------------------------------------------
|
||||||
; World table without dino
|
; World table without dino
|
||||||
WorldTable
|
WorldTable
|
||||||
@@ -87,8 +113,10 @@ WorldTable
|
|||||||
FirstSTART
|
FirstSTART
|
||||||
jsr ClearScreen
|
jsr ClearScreen
|
||||||
jsr GenerateCharsets
|
jsr GenerateCharsets
|
||||||
jsr SetGameScreen
|
jsr GenerateClouds
|
||||||
jsr FadeColorsIN
|
jsr FadeColorsIN
|
||||||
|
AnyKey
|
||||||
|
jsr SetGameScreen
|
||||||
NewGame
|
NewGame
|
||||||
jsr SetStatusToR
|
jsr SetStatusToR
|
||||||
jsr SetStart
|
jsr SetStart
|
||||||
@@ -122,6 +150,7 @@ EndLoopR
|
|||||||
waitRTC ; or waitRTC ?
|
waitRTC ; or waitRTC ?
|
||||||
mva #2 hscrol
|
mva #2 hscrol
|
||||||
jsr WorldShift ; better place (flickering)
|
jsr WorldShift ; better place (flickering)
|
||||||
|
jsr CloudsR
|
||||||
mva #>font4 chbas
|
mva #>font4 chbas
|
||||||
waitRTC ; or waitRTC ?
|
waitRTC ; or waitRTC ?
|
||||||
mva #1 hscrol
|
mva #1 hscrol
|
||||||
@@ -152,6 +181,7 @@ EndLoopL
|
|||||||
waitRTC ; or waitRTC ?
|
waitRTC ; or waitRTC ?
|
||||||
mva #3 hscrol
|
mva #3 hscrol
|
||||||
jsr WorldShift ; better place (flickering)
|
jsr WorldShift ; better place (flickering)
|
||||||
|
jsr CloudsL
|
||||||
mva #>font4l chbas
|
mva #>font4l chbas
|
||||||
waitRTC ; or waitRTC ?
|
waitRTC ; or waitRTC ?
|
||||||
mva #4 hscrol
|
mva #4 hscrol
|
||||||
@@ -262,6 +292,35 @@ SwapLoop
|
|||||||
rts
|
rts
|
||||||
.endp
|
.endp
|
||||||
;-----------------------------------------------
|
;-----------------------------------------------
|
||||||
|
.proc GenerateClouds
|
||||||
|
; first clear PMgraphics memory
|
||||||
|
ldy #$00
|
||||||
|
tya
|
||||||
|
;hide PM
|
||||||
|
sta CloudHpos
|
||||||
|
sta CloudHpos+1
|
||||||
|
sta CloudHpos+2
|
||||||
|
sta CloudHpos+3
|
||||||
|
@ sta PMgraph+$300,y
|
||||||
|
sta PMgraph+$400,y
|
||||||
|
sta PMgraph+$500,y
|
||||||
|
sta PMgraph+$600,y
|
||||||
|
sta PMgraph+$700,y
|
||||||
|
iny
|
||||||
|
bne @-
|
||||||
|
; now make 4 clouds
|
||||||
|
ldy #7
|
||||||
|
@ lda font1+$2e0,y ; cloud symbol ($5c)
|
||||||
|
sta PMgraph+$400+$78,y
|
||||||
|
sta PMgraph+$500+$80,y
|
||||||
|
sta PMgraph+$600+$78,y
|
||||||
|
sta PMgraph+$700+$80,y
|
||||||
|
dey
|
||||||
|
bpl @-
|
||||||
|
;hide PM
|
||||||
|
rts
|
||||||
|
.endp
|
||||||
|
;-----------------------------------------------
|
||||||
.proc ClearWorld
|
.proc ClearWorld
|
||||||
ldy #WORLD_LENGTH ; world size
|
ldy #WORLD_LENGTH ; world size
|
||||||
lda #0 ; ground
|
lda #0 ; ground
|
||||||
@@ -389,6 +448,26 @@ noInsert
|
|||||||
rts
|
rts
|
||||||
.endp
|
.endp
|
||||||
;-----------------------------------------------
|
;-----------------------------------------------
|
||||||
|
.proc CloudsL
|
||||||
|
inc CloudHpos
|
||||||
|
inc CloudHpos+1
|
||||||
|
inc CloudHpos+2
|
||||||
|
inc CloudHpos+3
|
||||||
|
inc CloudHpos+2
|
||||||
|
inc CloudHpos+3
|
||||||
|
rts
|
||||||
|
.endp
|
||||||
|
;-----------------------------------------------
|
||||||
|
.proc CloudsR
|
||||||
|
dec CloudHpos
|
||||||
|
dec CloudHpos+1
|
||||||
|
dec CloudHpos+2
|
||||||
|
dec CloudHpos+3
|
||||||
|
dec CloudHpos+2
|
||||||
|
dec CloudHpos+3
|
||||||
|
rts
|
||||||
|
.endp
|
||||||
|
;-----------------------------------------------
|
||||||
.proc ScoreUp
|
.proc ScoreUp
|
||||||
inc score+4
|
inc score+4
|
||||||
lda score+4
|
lda score+4
|
||||||
@@ -456,13 +535,20 @@ NoBird
|
|||||||
cmp #JumpLen ; max jump phase
|
cmp #JumpLen ; max jump phase
|
||||||
beq EndJump
|
beq EndJump
|
||||||
inc JumpPhase
|
inc JumpPhase
|
||||||
|
NoJump
|
||||||
|
; clouds
|
||||||
|
Clouds
|
||||||
|
ldy #3
|
||||||
|
@ lda CloudHpos,y
|
||||||
|
sta HPOSP0,y
|
||||||
|
dey
|
||||||
|
bpl @-
|
||||||
rts
|
rts
|
||||||
EndJump
|
EndJump
|
||||||
lda #0
|
lda #0
|
||||||
sta JumpPhase
|
sta JumpPhase
|
||||||
sta DinoState
|
sta DinoState
|
||||||
NoJump
|
beq NoJump
|
||||||
rts
|
|
||||||
.endp
|
.endp
|
||||||
;---------------------------------------------------
|
;---------------------------------------------------
|
||||||
.proc SetStatusToL
|
.proc SetStatusToL
|
||||||
@@ -950,6 +1036,13 @@ Down
|
|||||||
sta scorel,x
|
sta scorel,x
|
||||||
dex
|
dex
|
||||||
bpl @-
|
bpl @-
|
||||||
|
;randomize clouds
|
||||||
|
ldy #3
|
||||||
|
@ lda RANDOM
|
||||||
|
sta CloudHpos,y
|
||||||
|
dey
|
||||||
|
bpl @-
|
||||||
|
jsr Animate.Clouds
|
||||||
rts
|
rts
|
||||||
.endp
|
.endp
|
||||||
;-----------------------------------------------
|
;-----------------------------------------------
|
||||||
@@ -1060,8 +1153,8 @@ FadeColor
|
|||||||
cpy #$10
|
cpy #$10
|
||||||
bne FadeColor
|
bne FadeColor
|
||||||
lda #$0f
|
lda #$0f
|
||||||
sta COLOR2
|
|
||||||
sta COLOR4
|
sta COLOR4
|
||||||
|
sta COLOR2
|
||||||
rts
|
rts
|
||||||
.endp
|
.endp
|
||||||
;-----------------------------------------------
|
;-----------------------------------------------
|
||||||
@@ -1082,8 +1175,25 @@ FadeColor
|
|||||||
.proc SetGameScreen
|
.proc SetGameScreen
|
||||||
mwa #GameDL dlptrs
|
mwa #GameDL dlptrs
|
||||||
lda #@dmactl(standard|dma|players|missiles|lineX1) ; normal screen width, DL on, P/M on
|
lda #@dmactl(standard|dma|players|missiles|lineX1) ; normal screen width, DL on, P/M on
|
||||||
|
lda #%00111110
|
||||||
sta dmactls
|
sta dmactls
|
||||||
mva #>font1 chbas
|
mva #>font1 chbas
|
||||||
|
mva #>PMgraph PMBASE
|
||||||
|
lda #%00011111 ; P/M on
|
||||||
|
sta GRACTL
|
||||||
|
lda #$0a
|
||||||
|
sta COLPM0
|
||||||
|
sta COLPM1
|
||||||
|
sta COLPM2
|
||||||
|
sta COLPM3
|
||||||
|
lda #90
|
||||||
|
sta HPOSP0
|
||||||
|
lda #70
|
||||||
|
sta HPOSP1
|
||||||
|
lda #60
|
||||||
|
sta HPOSP2
|
||||||
|
lda #80
|
||||||
|
sta HPOSP3
|
||||||
rts
|
rts
|
||||||
.endp
|
.endp
|
||||||
;-----------------------------------------------
|
;-----------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user