5kids2feed
Well-known member
Weird thing I got going on.
If I have my player attack (press b) while holding the left or right button, his animation after the attack finishes will be "stopped" but he will move which ever direction i'm holding..
If I have my player attack.. while not holding left or right he will "go back to first" like I have it set to which is stopped. Then I press left or right and his animation will finally be the walking/moving animation.
Here is my attack code.. Any idea how to fix this so his animation will be moving in my first paragraph?:
P.S. I don't want after the attack end action to go to moving because he'll just sit there walking and it looks odd if i'm not pressing anything.
If I have my player attack (press b) while holding the left or right button, his animation after the attack finishes will be "stopped" but he will move which ever direction i'm holding..
If I have my player attack.. while not holding left or right he will "go back to first" like I have it set to which is stopped. Then I press left or right and his animation will finally be the walking/moving animation.
Here is my attack code.. Any idea how to fix this so his animation will be moving in my first paragraph?:
Code:
TXA
STA temp ;; assumes the object we want to move is in x.
GetActionStep temp
CMP #$02
BNE +notHurt
RTS
+notHurt
CMP #$07
BNE +notHurt3
RTS
+notHurt3
;StopMoving temp, #$FF, #$00
ChangeActionStep temp, #$02
PlaySound #sfx_sharkattack
LDX player1_object
TXA
STA temp
GetObjectDirection temp ;; temp still observed from above.
CMP #$02
BNE +notRight
;;; CREATE RIGHT WEAPON
LDX player1_object
LDA Object_x_hi,x
CLC
ADC #$08 ;weapon right x
STA tempA
LDA Object_screen,x
ADC #$00
STA tempD
LDA Object_y_hi,x
CLC
ADC #$08 ;weapon right y
STA tempB
LDA #$02 ;weapon
STA tempC
CreateObjectOnScreen tempA, tempB, tempC, #$00, tempD
LDA #%11000000
STA Object_direction,x
JMP +doneWithCreatingWeapon
+nocreate
JMP +doneWithCreatingWeapon
+notRight
;;; CREATE LEFT WEAPON
LDX player1_object
LDA Object_x_hi,x
CLC
ADC #255 ;weapon left x
STA tempA
LDA Object_screen,x
SBC #$00
STA tempD
LDA Object_y_hi,x
CLC
ADC #$08 ;weapon left y
STA tempB
LDA #$02 ;weapon
STA tempC
CreateObjectOnScreen tempA, tempB, tempC, #$00, tempD
LDA #%10000000
STA Object_direction,x
JMP +doneWithCreatingWeapon
+notLeft
+doneWithCreatingWeapon
RTS
P.S. I don't want after the attack end action to go to moving because he'll just sit there walking and it looks odd if i'm not pressing anything.
Last edited: