Saulus_Lira
Member
dale_coop said:Share your script (StartMovingPlayerDown), we can check if there's a error
Also, when you share script on the forum, use the < code /> tag (in the "Full Editor & Preview")
Sorry for the delay to reply. Here goes the code.
;;;;; START MOVING PLAYER UP:
;;;;; We will use this when the up button is pressed.
;;;;; If we are already showing the walking animation, which is for this module
;;;;; action step 1, we will skip changing to the walking state.
LDA Object_movement,x
AND #%00000111
CMP #%00000100
BCS +
LDA #FACE_RIGHT
STA temp2
JMP ++
+
LDA #FACE_LEFT
STA temp2
++
LDX player1_object
GetCurrentActionType player1_object
CMP #$02 ;; if the state is attacking
BEQ ++ ; skip movement if attacking
CMP #$03
BEQ ++ ;skip if we are casting spell
CMP #$01
BEQ + ;; if the action type already equals 1, jump forward
ChangeObjectState #$01, #$04
+
;;;;;; Then, we will begin moving.
StartMoving player1_object, MOVE_UP
++
;;;;;; Lastly, we will change the facing direction.
FaceDirection player1_object, temp2
RTS
;;;;; START MOVING PLAYER DOWN:
;;;;; We will use this when the up button is pressed.
;;;;; If we are already showing the walking animation, which is for this module
;;;;; action step 1, we will skip changing to the walking state.
LDA Object_movement,x
AND #%00000111
CMP #%00000100
BCS +
LDA #FACE_RIGHT
STA temp2
JMP ++
+
LDA #FACE_LEFT
STA temp2
++
LDX player1_object
GetCurrentActionType player1_object
CMP #$02 ;; if the state is attacking
BEQ ++ ; skip movement if attacking
CMP #$03
BEQ ++ ;skip if we are casting spell
CMP #$01
BEQ + ;; if the action type already equals 1, jump forward
ChangeObjectState #$01, #$04
+
;;;;;; Then, we will begin moving.
StartMoving player1_object, MOVE_DOWN
++
;;;;;; Lastly, we will change the facing direction.
FaceDirection player1_object, temp2
RTS