• 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!

An Inquiry About Sprite Control

C

Ceddil

Guest
Hey All!
I have finished a game. Well, "finished" in the sense that I have all the programming and mechanics, but no art. I was going to make some animations for my player, but don't know how to control that. For starters, how would I make my character walk down/left/up/right and change between them depending on the direction it is going? And, would I make 4 different sprite sets, or would I cram it all into one and distinguish it?
I hope this made sense and Thank You!
-Ceddil
 
H

Halph-Price

Guest
Hey All!
I have finished a game. Well, "finished" in the sense that I have all the programming and mechanics, but no art. I was going to make some animations for my player, but don't know how to control that. For starters, how would I make my character walk down/left/up/right and change between them depending on the direction it is going? And, would I make 4 different sprite sets, or would I cram it all into one and distinguish it?
I hope this made sense and Thank You!
-Ceddil
Look over some
https://docs.yoyogames.com/source/dadiospice/002_reference/objects and instances/instances/instance properties/index.html

There's basically 2 different factors, sort of like you mention. Either changing image_index or changing sprite_index. sprite_index is changing different sprite sets. image_index is changing different sub image for each sprite set. So sprite_index changes which sprite you're using, image_index changes which frame of that sprite you're viewing. Most people usually cram all the frames into one sprite set and just change the image_index, as this gives you the most control over animation.

I mean for most animations you only need 2 to 6 frames for anything, so it's usually pretty manageable to just change the image_index as needed with all the frames crammed into one sprite set, but it is easier to just change sprite_index for each animation.

is sort of what you're looking for

Something to keep in mind is depth of the objects, if it's not directly overhead or side view, you can just set depth to equal x value if it's an isometric view.

Sprite_index is the overall sprite set you're using, image_index is each from of that sprite, image_speed is how fast per step it will animate the sprite.

There's a lot of choices, but having 4 different sprite sets is probably the best bet.
 

TheouAegis

Member
Are you going to manually specify when and where to change each frame of each animation? Or do you want the game to do it for you? If you want gamemaker to handle all of the animation for you, then it is easiest to use one Sprite per direction per animation. In other words, one Sprite per Direction walking, one sprite per direction attacking, etc etc.
 
Top