Game Jam 1 - Animations

To create the animation for a sprite i had to define a variable that links with the type of animation it is .This sprite includes several frames of the character in different positions as they fall or jump.
In the character's code, i added a variable to track whether they are currently falling or not. The variable became sPlayerFall and was set to true when the character jumps or falls off a platform.
In the step event for your character, add a check to see if the "falling" variable is true. If it is, set the character's sprite to the falling animation and play the animation to not bug out the rest of the game.
To play the animation, I used the image_index variable, which told Gamemaker which frame of the sprite to display. I started off with turning the image_index at 0 to not play the animation until it would have been set to true. I kept adapting the fps to see the most realistic animation. Once the value is set to false the animation stops. I have the falling animation on the first one. The Idle animation on the second, jumping and then running.




 

Comments

Popular Posts