smilehero65
Active member
Has it ever bothered you how every time the character falls from a place without pressing A, the running or idle animation still shows?
I just came up with a simple way to get around this.
EDIT: This method is far more optimized than my previous one! It also gets rid of a glitch I noticed where the player was not showing the fall animation when idle.
TUTORIAL:
1. I'm using the Simplified Inputs from baardbi (which I personally think it's the best way to handle Platformer inputs)
2. To make things easy, let's make our Jump State be our Falling State, which by default is Action 02.
3. Go to your Handle Physics Script and go to the label +notSolid: (in the standard platform module should be around Line 590)
Before the comment ;; is not solid, don't land. place this code:
4. In your Input Scripts, remember to disable the display of your idle and run animations when you're in fall state.
Here is an example of how my left input is set:
5. Then you should be DONE!
Things to take into consideration:
Feel free to correct me, ask me anything, or help me improve this!
**Credits to Mugi that gave the basis for this code in the thread: Jump/Fall? + Extras
I just came up with a simple way to get around this.
EDIT: This method is far more optimized than my previous one! It also gets rid of a glitch I noticed where the player was not showing the fall animation when idle.
TUTORIAL:
1. I'm using the Simplified Inputs from baardbi (which I personally think it's the best way to handle Platformer inputs)
2. To make things easy, let's make our Jump State be our Falling State, which by default is Action 02.
3. Go to your Handle Physics Script and go to the label +notSolid: (in the standard platform module should be around Line 590)
Before the comment ;; is not solid, don't land. place this code:
Code:
;;;;;;;;;;;;;;;;;;;;;; FALLING ;;;;;;;;;;;;;;;;;;;;;
CPX player1_object ;;;Check for Player
BNE +isPlayer
STX temp ;; assumes the object we want to move is in x.
GetActionStep temp
CMP #$02
BNE +isalreadyfalling ;;;;is Player already in Fall State?
JMP doneFalling
+isalreadyfalling
LDA Object_v_speed_lo,x ; load player's vertical movement speed
BPL +dothis
ChangeActionStep temp, #$02
JMP doneFalling
+dothis
+isPlayer
doneFalling:
4. In your Input Scripts, remember to disable the display of your idle and run animations when you're in fall state.
Here is an example of how my left input is set:
Code:
STX temp ;; assumes the object we want to move is in x.
GetActionStep temp
CMP #$07
BNE +notHurt
RTS
+notHurt
StartMoving temp, #LEFT
STX temp ;; assumes the object we want to move is in x.
ChangeFacingDirection temp, #FACE_LEFT
GetActionStep temp
CMP #1 ;Walk
BEQ +
CMP #2 ;Jump ---------ALSO MY FALL STATE
BEQ +
ChangeActionStep temp, #1 ;Change to walk state
+
RTS
5. Then you should be DONE!
Things to take into consideration:
- Unfortunately, due to this little bug when colliding with the ground in a fall, the falling state shows in a brief second after touching the ground. The only way to fix this is by removing that bug, if that was possible, this code should still function.
- Sorry if there are any errors in my explanation or process, it is my first tutorial and feedback is welcomed!
Feel free to correct me, ask me anything, or help me improve this!
**Credits to Mugi that gave the basis for this code in the thread: Jump/Fall? + Extras
Last edited: