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

Jumping withing one animated sprite

Good morning, everybody!

That topic was certainly solved, elsewhere inside. Or something similar.
I´ve got a special intention. Maybe that could be solved with states.
But I asked myself, and now you, what about jumping within an animated sprite.

Example:

oPlayer collides (place_meeting) with oSidekick (linked to sSidekick(animated Idle)).
That concerning idle is waiting (image_speed = 0 as long as !place_meeting oPlayer).
But on place_meeting with oPlayer, the image_speed is turning to 1. The idle is lifting
his arm til Image_index 6, than (within that one sprite) a waving-loop starts from image 7
over to 18, and returns to 7... aso... UNTIL oPlayer is leaving the collision mask of Sidekick-Idle.
That means (on leaving him) the arm goes down, starting from image_index 19 over to 22.
Then repositioning on image_index 1, image_speed = 0.

You know, what I mean?
I would like to handle a collision and the animation control, working on just one animation-idle,
and how would you implement?

Is that possible, and makes that sense? Or would you recommend to seperate these states
in different sprites?

Best wishes from
Archie.
 

GMWolf

aka fel666
I think separating the states makes more sense, as you can now refer to the different animation states by name.

But if you really want to keep them all into one big sprite, you can set image_index manually.
 
Top