Skip to content

Commit

Permalink
Simplify the code for turning fire+down into horizontal attack when d…
Browse files Browse the repository at this point in the history
…ucking.
  • Loading branch information
cadaver committed Feb 10, 2018
1 parent 975ddd4 commit 684bb45
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 deletions.
14 changes: 0 additions & 14 deletions player.s
Original file line number Diff line number Diff line change
Expand Up @@ -128,20 +128,6 @@ MP_NoPlayerScroll:
lda menuMode ;No new controls in inventory / interaction / dialogue
bne MP_SetWeapon
lda joystick
ldy actF1+ACTI_PLAYER
cpy #FR_DUCK+1 ;Turn ducking down+fire to left+fire or right+fire, depending on dir
bne MP_NoDuckFireCtrl
cmp #JOY_DOWN+JOY_FIRE
bne MP_NoDuckFireCtrl
lda #JOY_FIRE+JOY_RIGHT
ldy actD
bpl MP_NoDuckFireCtrl
eor #JOY_LEFT|JOY_RIGHT
MP_NoDuckFireCtrl:
ldy #$ff
MP_StoreControlMask:
sty MP_ControlMask+1
MP_ControlMask: and #$ff
sta actCtrl+ACTI_PLAYER
cmp #JOY_FIRE
bcc MP_NewMoveCtrl
Expand Down
9 changes: 9 additions & 0 deletions weapon.s
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,15 @@ AH_NotPlayer: lda actCtrl,x
sta actD,x
AH_NoTurn2: lda actCtrl,x
AH_NoTurn: and #JOY_UP|JOY_DOWN|JOY_LEFT|JOY_RIGHT
cmp #JOY_DOWN ;Turn DOWN attack into horizontal when player ducks
bne AH_NoPlayerDuckFire
cpx #ACTI_PLAYER
bne AH_NoPlayerDuckFire
ldy actF1+ACTI_PLAYER
cpy #FR_DUCK+1
bne AH_NoPlayerDuckFire
lda #JOY_RIGHT
AH_NoPlayerDuckFire:
tay
lda attackTbl,y
bmi AH_NoAttack2
Expand Down

0 comments on commit 684bb45

Please sign in to comment.