mirror of
https://github.com/lscharen/iigs-game-engine.git
synced 2024-06-11 07:29:32 +00:00
Small PoC to validate animation timers working
This commit is contained in:
parent
f55192436a
commit
4d6b97ed2c
|
@ -21,3 +21,5 @@
|
||||||
SNA RotData
|
SNA RotData
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,10 @@
|
||||||
PlayerX equ AppSpace
|
PlayerX equ AppSpace
|
||||||
PlayerY equ AppSpace+2
|
PlayerY equ AppSpace+2
|
||||||
|
|
||||||
|
; Timer handle
|
||||||
|
TimerHndl dw $FFFF
|
||||||
|
IntroCounter ds 2
|
||||||
|
|
||||||
phk
|
phk
|
||||||
plb
|
plb
|
||||||
|
|
||||||
|
@ -23,39 +27,30 @@ PlayerY equ AppSpace+2
|
||||||
|
|
||||||
ldx #0 ; Use full-screen mode
|
ldx #0 ; Use full-screen mode
|
||||||
jsl SetScreenMode
|
jsl SetScreenMode
|
||||||
|
bcs *+5
|
||||||
|
sta TimerHndl
|
||||||
|
|
||||||
|
|
||||||
|
stz IntroCounter
|
||||||
|
ldx #^IntroTask
|
||||||
|
lda #IntroTask
|
||||||
|
ldy #10 ; Play at 6 fps
|
||||||
|
jsl AddTimer
|
||||||
|
bcs *+5
|
||||||
|
sta TimerHndl
|
||||||
|
|
||||||
:loop
|
:loop
|
||||||
|
jsl DoTimers
|
||||||
jsl ReadControl
|
jsl ReadControl
|
||||||
and #$007F ; Ignore the buttons for now
|
and #$007F ; Ignore the buttons for now
|
||||||
|
|
||||||
cmp #'q'
|
cmp #'q'
|
||||||
beq :exit
|
beq :exit
|
||||||
|
|
||||||
; WASD for player movement
|
; Just keep drawing the player. The timer task will animate the position
|
||||||
|
|
||||||
cmp #'w'
|
jsr DrawPlayer
|
||||||
bne :not_w
|
bra :loop
|
||||||
jsr :moveup
|
|
||||||
brl :loop
|
|
||||||
:not_w
|
|
||||||
|
|
||||||
cmp #'a'
|
|
||||||
bne :not_a
|
|
||||||
jsr :moveleft
|
|
||||||
brl :loop
|
|
||||||
:not_a
|
|
||||||
|
|
||||||
cmp #'s'
|
|
||||||
bne :not_s
|
|
||||||
jsr :movedown
|
|
||||||
brl :loop
|
|
||||||
:not_s
|
|
||||||
|
|
||||||
cmp #'d'
|
|
||||||
bne :not_d
|
|
||||||
jsr :moveright
|
|
||||||
:not_d
|
|
||||||
brl :loop
|
|
||||||
|
|
||||||
:moveup
|
:moveup
|
||||||
lda PlayerY
|
lda PlayerY
|
||||||
|
@ -103,6 +98,29 @@ PlayerY equ AppSpace+2
|
||||||
qtRec adrl $0000
|
qtRec adrl $0000
|
||||||
da $00
|
da $00
|
||||||
|
|
||||||
|
; Play a scripted animation
|
||||||
|
IntroTask
|
||||||
|
phb
|
||||||
|
phk
|
||||||
|
plb
|
||||||
|
|
||||||
|
lda IntroCounter
|
||||||
|
and #$0007
|
||||||
|
asl
|
||||||
|
asl
|
||||||
|
tax
|
||||||
|
|
||||||
|
lda IntroPath,x ; X coordinate
|
||||||
|
sta PlayerX
|
||||||
|
lda IntroPath+2,x ; Y coordinate
|
||||||
|
sta PlayerY
|
||||||
|
|
||||||
|
inc IntroCounter
|
||||||
|
plb
|
||||||
|
rtl
|
||||||
|
|
||||||
|
IntroPath dw 0,0,10,0,20,0,20,5,20,7,35,15,50,17,80,20
|
||||||
|
|
||||||
DrawPlayer
|
DrawPlayer
|
||||||
lda PlayerY
|
lda PlayerY
|
||||||
asl
|
asl
|
||||||
|
@ -122,3 +140,17 @@ StackAddress ds 2
|
||||||
PUT sprites/Ships.s
|
PUT sprites/Ships.s
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user