chronicleroflegends
Member
I am trying to make a megaman style slide/dash action script, and it almost works just right!
I am having trouble determining the player's facing direction however.
Here is what I have so far:
This code will dash, but it will only go left. My check for player's facing direction doesn't seem to work.
Also, if this code helps you in any way feel free to use it!
I am having trouble determining the player's facing direction however.
Here is what I have so far:
Code:
;; MODIFIED FROM DEFAULT JUMP SCRIPT
;; Get player object
;; Check if in air, and skip if so.
LDX player1_object
LDA Object_status,x
AND #%00000100
BEQ +
;; Check facing direction
LDA Object_movement,x
AND #%00000111 ;only keep the last 3 bits
CMP #$00000110 ;facing right
BEQ slideRight
JMP slideLeft
slideRight:
;FACE_RIGHT = #%00000010
LDA #$00
SEC
ADC #$03
STA Object_h_speed_hi,x
slideLeft:
;FACE_LEFT = #%00000110
;; Store 250 in accumulator and assign it to object's speed
LDA #$00
SEC
SBC #$03
STA Object_h_speed_hi,x
ChangeObjectState #$07, #$02 ;Set the object's animation state (my dash action is 7)
;PlaySound #SFX_PLAYER_JUMP
+
RTS
This code will dash, but it will only go left. My check for player's facing direction doesn't seem to work.
Also, if this code helps you in any way feel free to use it!