Added power level controls

This commit is contained in:
blondie7575 2017-09-05 12:55:27 -07:00
parent c7efb24fe7
commit 015f4c2da1
4 changed files with 73 additions and 1 deletions

View File

@ -66,9 +66,15 @@ gameplayLoopKbd:
gameplayLoopAngle:
; Update aim angle if needed
lda angleDeltaRequested
beq gameplayLoopFire
beq gameplayLoopPower
jsr changeAngle
gameplayLoopPower:
; Update power if needed
lda powerDeltaRequested
beq gameplayLoopFire
jsr changePower
gameplayLoopFire:
lda fireRequested
beq gameplayLoopProjectiles
@ -171,6 +177,23 @@ changeAngle:
rts
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; changePower
;
; Handles changing a player's power
;
changePower:
ldy currentPlayer
tax
jsr playerDeltaPower
ldy currentPlayer
jsr renderPlayerHeader
stz powerDeltaRequested
rts
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; fire
;
@ -191,6 +214,8 @@ mapScrollRequested:
.word $FFFF
angleDeltaRequested:
.word $0000
powerDeltaRequested:
.word $0000
fireRequested:
.word $0000
turnRequested:

Binary file not shown.

16
input.s
View File

@ -28,6 +28,10 @@ kbdScan:
beq kbdScanA
cmp #('z' + $80)
beq kbdScanZ
cmp #('s' + $80)
beq kbdScanS
cmp #('x' + $80)
beq kbdScanX
cmp #(' ' + $80)
beq kbdScanSpace
cmp #(27 + $80)
@ -76,6 +80,18 @@ kbdScanZ:
sta angleDeltaRequested
rts
kbdScanS:
BITS16
lda #1
sta powerDeltaRequested
rts
kbdScanX:
BITS16
lda #-1
sta powerDeltaRequested
rts
kbdScanSpace:
BITS16
lda #1

View File

@ -100,6 +100,37 @@ playerDeltaAngleClampHigh:
bra playerDeltaAngleStore
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; playerDeltaPower
;
; Y = Player index
; X = Delta
;
playerDeltaPower:
SAVE_AXY
PLAYERPTR_Y
txa
clc
adc playerData+PD_POWER,y
beq playerDeltaPowerClampLow
cmp #15
bpl playerDeltaPowerClampHigh
playerDeltaPowerStore:
sta playerData+PD_POWER,y
RESTORE_AXY
rts
playerDeltaPowerClampLow:
lda #1
bra playerDeltaPowerStore
playerDeltaPowerClampHigh:
lda #15
bra playerDeltaPowerStore
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; playerFire
;