• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Jump Animation Basics

king javo

Member
This should be a simple question, but I can't seem to find anything useful with my initial searches across the web.

Here's the question... if I have a set of frames to show a jump animation, is it (a) better practice to have each frame's canvas size with a tall enough height to allow the frames to store the jumping animation or (b) crop the canvas size to simply the sprite height and width and force the GML code to do the simulating of the jump (basically moving the player up and down on the y-axis)?

My current jump animation has around 8 frames, which I like as opposed to 1 frame for jumping up and 1 for jumping down as I've seen in many tutorials. I know it can add more complexity, but I was curious if it was the way to go as well or if the 1 each method is better and why?

Also, if anyone has any movement code to show as an example of how to use multiple jump frame animations then I'd be grateful if you wouldn't mind sharing a snippet here.

(a)
upload_2017-6-29_20-34-59.png

(b)
upload_2017-6-29_20-36-7.png
 

TheouAegis

Member
Manipulate the y coordinate; don't waste sprite space. You can base the sprite on the vertical speed, or script it out yourself, or just animate once you peak.
 

king javo

Member
Manipulate the y coordinate; don't waste sprite space. You can base the sprite on the vertical speed, or script it out yourself, or just animate once you peak.
Ok, so are you saying don't using multiple frames also or I can use more than up and down frames easily?
 

king javo

Member
Use multiple frames if you want. You just have to decide when and how to animate the frames.
Would you happen to have any code or advice how to best set the image_index for each frame on a jump? My game is a top-down game to give you a reference. If not, I'm sure I'll whip up something but I'm still learning so trying to get the expert advice whenver possible.
 

TheouAegis

Member
Well how are you handling the jumping? And then from there, how do you want it to animate? I know nothing about your sprite or the way it should look. What is the duration of each frame? Can you make do with simply using image_speed to animate the jumping sprite? Or do some frames display longer than others?
 
Top