To stop the player when attacking:
In your attack input script, around line 56, add:
Code:
;; dale_coop: stop the Player's movements:
LDA #$00
STA Object_h_speed_lo,x
STA Object_h_speed_hi,x
STA Object_v_speed_lo,x
STA Object_v_speed_hi,x
LDA Object_direction,x
AND #%00000111
STA Object_direction,x
;; and stop the scrolling:
LDA scrollByte
AND #%00111110
ORA #%00000010
STA scrollByte
To play an animation when he's attacking, also add that line:
Code:
ChangeActionStep player1_object, #$03 ;; <-- HERE use the action step you want for the "attack" state
AND, now, in all your movement input scripts, you find:
Code:
GetActionStep temp
CMP #$07
BNE +notHurt
RTS
+notHurt
That code prevent from moving when the player is in his "hurt" state...
So, all you need to do is adding a code to also prevent when he is in his "attack" state (for example igf you are using action step #$03 for attack state / animation):
Code:
GetActionStep temp
CMP #$07
BNE +notHurt
RTS
+notHurt
CMP #$03 ;; is the player attacking ?
BNE +notAttacking
RTS
+notAttacking:
Note: if you want to use another action step for your player's attack animation, just replace the #$03 by the other value (#$04 for action step 4, for example)
Your attack animation needs to be short (set a short timer value "1" with a "endAction" to GoToFirst... or EndAnimation to "GoToFirst" with a short animation speed):
View attachment 6475
View attachment 6474