2018-12-22 18:41:12 +00:00
|
|
|
;
|
|
|
|
; fan
|
|
|
|
; Code and data structures related to the special fan weapon
|
|
|
|
;
|
|
|
|
; Created by Quinn Dunki on 8/15/18
|
|
|
|
;
|
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
; deployFan
|
|
|
|
;
|
|
|
|
; Y: Index to projectile structure
|
|
|
|
;
|
|
|
|
deployFan:
|
|
|
|
SAVE_AY
|
|
|
|
|
|
|
|
lda #200 ; Drop in from the top of the view
|
|
|
|
sta projectileData+GO_POSY,y
|
|
|
|
|
|
|
|
lda #$c80
|
|
|
|
sta projectileData+JD_PRECISEY,y
|
|
|
|
|
|
|
|
lda #0
|
|
|
|
sta projectileData+JD_VX,y
|
|
|
|
sta projectileData+JD_VY,y
|
|
|
|
|
|
|
|
RESTORE_AY
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
; updateFan
|
|
|
|
;
|
2018-12-24 00:39:22 +00:00
|
|
|
; Y = Offset to projectile structure
|
2018-12-22 18:41:12 +00:00
|
|
|
;
|
|
|
|
updateFan:
|
2018-12-24 00:39:22 +00:00
|
|
|
SAVE_AXY
|
2018-12-22 18:41:12 +00:00
|
|
|
|
|
|
|
; Wait for fan to collide with us as it falls from the sky
|
|
|
|
lda projectileData+GO_POSX,y
|
|
|
|
sta rectParams
|
|
|
|
lda projectileData+GO_POSY,y
|
|
|
|
sta rectParams+2
|
|
|
|
lda #GAMEOBJECTWIDTH
|
|
|
|
sta rectParams+4
|
|
|
|
lda #GAMEOBJECTHEIGHT
|
|
|
|
sta rectParams+6
|
|
|
|
|
2018-12-24 00:39:22 +00:00
|
|
|
ldx currentPlayer
|
2018-12-22 18:41:12 +00:00
|
|
|
jsr playerIntersectRect
|
|
|
|
cmp #0
|
|
|
|
beq updateFanDone
|
|
|
|
|
|
|
|
updateFanDone:
|
2018-12-24 00:39:22 +00:00
|
|
|
RESTORE_AXY
|
2018-12-22 18:41:12 +00:00
|
|
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|