GMS 2 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