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

GameMaker Best way to manage sub animation in just one sprite.

P

!Paolunx

Guest
Hi everybody. I would like to figure out the best way to manage different animations using just one sprite.

For example in my player's sprite I've got:
- frames 1-3 idle
- frames 4-7 run
- frames 8-12 jump ans so on..

What I want to do is loop multiple subimages on event need.
Thank you, I'm new in game dev so I'm a bit stuck right now.
 

GMWolf

aka fel666
Well the best way is not to do that.
Just use different sprites for each thing.
There is no reason to want to put everything in a single sprite.

If you need to somehow tie them together into a single identity, use an array:
Code:
player_sprites[0] = spr_run;
player_sprites[1] = spr_walk;
...
If you don't understand arrays, then it's ok. Ignore that last part.
 
P

!Paolunx

Guest
Well the best way is not to do that.
Just use different sprites for each thing.
There is no reason to want to put everything in a single sprite.

If you need to somehow tie them together into a single identity, use an array:
Code:
player_sprites[0] = spr_run;
player_sprites[1] = spr_walk;
...
If you don't understand arrays, then it's ok. Ignore that last part.
Thank you for your reply! I'm not so into arrays but I can look for them If you tell me that is the best way :D

Yeah I wanted to avoid to do separete sprites for each animation due the fact that I've got the free trial of GM2 .
 

GMWolf

aka fel666
Yeah I wanted to avoid to do separete sprites for each animation due the fact that I've got the free trial of GM2 .
Ah I see...
Well, in that case... You could try to "cheat" that way, but it's going to require quite a bit more code to get going.
 
Top