mirror of
https://github.com/blondie7575/GSCats.git
synced 2025-02-27 05:29:23 +00:00
Added option for weapon deployment delay
This commit is contained in:
parent
1deb78eb84
commit
7d3ae38f8f
@ -70,6 +70,7 @@ JD_OWNER = 146
|
||||
JD_FACING = 148
|
||||
JD_SCRATCH = 150
|
||||
JD_AGE = 152
|
||||
JD_DEPLOYDELAY = 154
|
||||
|
||||
MAXPROJECTILES = 3
|
||||
|
||||
|
14
fan.s
14
fan.s
@ -8,7 +8,7 @@
|
||||
FANRANGE = 100 ; In pixels
|
||||
FANMAGNITUDE = $20 ; 12.4 fixed point speed delta, in pixels
|
||||
FAN_AGE = 4
|
||||
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
; deployFan
|
||||
;
|
||||
@ -27,6 +27,9 @@ deployFan:
|
||||
sta projectileData+JD_VX,y
|
||||
sta projectileData+JD_VY,y
|
||||
|
||||
lda #1
|
||||
sta projectileData+JD_DEPLOYDELAY,y ; Let player admire new fan
|
||||
|
||||
RESTORE_AY
|
||||
rts
|
||||
|
||||
@ -81,7 +84,7 @@ updateFan:
|
||||
sec
|
||||
sbc #GAMEOBJECTHEIGHT
|
||||
sta gameObjectPool+GO_POSY,x
|
||||
|
||||
|
||||
updateFanDone:
|
||||
RESTORE_AXY
|
||||
rts
|
||||
@ -148,6 +151,13 @@ renderFan:
|
||||
lda #14
|
||||
jsr renderGameObject
|
||||
|
||||
; Do deployment delay after first render
|
||||
lda projectileData+JD_DEPLOYDELAY,y
|
||||
beq renderFanDone
|
||||
jsr delayLong
|
||||
lda #0
|
||||
sta projectileData+JD_DEPLOYDELAY,y
|
||||
|
||||
renderFanDone:
|
||||
RESTORE_AXY
|
||||
rts
|
||||
|
BIN
gscats.2mg
BIN
gscats.2mg
Binary file not shown.
@ -26,8 +26,9 @@ projectileData:
|
||||
.word 0 ; Facing (0,1) = (+X,-X)
|
||||
.word 0 ; Scratch space for subclasses
|
||||
.word 0 ; Age (in turns)
|
||||
.word 0 ; Deployment delay needed?
|
||||
|
||||
.repeat 102
|
||||
.repeat 100
|
||||
.byte 0 ; Padding to 256-byte boundary
|
||||
.endrepeat
|
||||
|
||||
|
21
utility.s
21
utility.s
@ -180,3 +180,24 @@ delayShortInner:
|
||||
|
||||
RESTORE_AXY
|
||||
rts
|
||||
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
; delayLong
|
||||
; Sleeps for long time (about 1.5 sec, but not calculated as such)
|
||||
;
|
||||
delayLong:
|
||||
SAVE_AXY
|
||||
|
||||
ldy #$03 ; Loop a bit
|
||||
delayLongOuter:
|
||||
ldx #$ff
|
||||
delayLongInner:
|
||||
jsr delayShort
|
||||
dex
|
||||
bne delayLongInner
|
||||
dey
|
||||
bne delayLongOuter
|
||||
|
||||
RESTORE_AXY
|
||||
rts
|
||||
|
Loading…
x
Reference in New Issue
Block a user