angelwire
Member
AESnips is a system that allows objects to effortlessly handle simple or complex sprite animation playback for you.
Marketplace Link: https://marketplace.yoyogames.com/assets/9275/aesnips-animation-system
Summary:
Create "Snips" and simply tell an object to play the Snip animation and the system will handle everything for you.
No more worrying about sprite_index, image_index or writing complex code in the Animation End Event
For use in GMS 2.3
Documentation is available here: https://docs.google.com/document/d/1JSGG1mfid8lOiSictlqFUEiaxrTep1TUyvLne1Z2Yr0
Snips are powerful
Transitions between Snips make animations much more fluid. Any time you play a Snip you have the option to have the system try to find a Transition to bridge the gap between the Snip that is currently playing and the Snip you want to play. The system also automatically handles Snips that finish playing based on their end type. Snips can play once and stop, they can continually repeat, they can pingpong, and they can even call functions when done playing.
You can assign a function to be executed for each frame in a Snip - which is super useful for firing bullets or throwing objects.
Snips are dynamic
Each sprite frame can have its own speed. Split second delays can be added into animations without copy/pasting sprite frames or writing extra code.
Loops can be added to Snip animations to repeat certain frames. No more copy/pasting sprite frames to make your animations longer. Snip properties, frame speeds, and Loop repetition can be changed in-game, which means your animations can dynamically react to events in the game.
Snips are easy
Add one line to the animated objects’ Create Event, and Step Event it is ready to play Snip animations.
Create Snips with one line of code, play Snips with one line of code. Transitions and Loops can also be created with a single line of code and then you can completely forget about writing any more logic to handle them.
If you want more control over the Snips there are a lot of helpful “arbiter” functions that give you control without requiring you to memorize all the variable names.
Check the source code for the demo and to see just how easy it is to use.
Snips are growing
AESnips is still growing and I would love to be able to add more features to fit the needs of GameMaker developers who have interest in the system. If you’re making a game that relies heavily on sprite animations I would love to hear from you on what more you want from a system like this.
Quick how-to-use:
Any Object that uses Snips MUST call a function in the Create Event and Step Event. The functions are named appropriately:
- snip_create_event()
- snip_step_event()
You can make changes to a Snip's frames' speed or assign a script to each frame with snip_set_frame_speed(...) and snip_set_frame_script(...)
When you want your object to play a Snip use snip_play(Snip, transition?). Use snip_play_next(Snip, transition?) to queue up a Snip to play after the current Snip is done playing.
You can pause individual objects or all Snips by having the object call snip_pause()/snip_resume() and snip_global_pause()/snip_global_resume()
New feature for Snips v0.1.4 - SnipPlayer:
Before this feature, Snips were totally tied to an Object's built-in variables (image_index, sprite_index, x,y, image_xscale...). This meant that Objects were limited to only 1 Snip. A SnipPlayer is a struct that will sort of take the place of the object's built-in variables and allow objects to play multiple Snips at the same time - or draw copies the same Snip anywhere in the room. Instead of needing 1 Object per Snip, an Object can control multiple SnipPlayers and draw them any number of times. To use a SnipPlayer, create a Snip and set it up just like you normally would. Then you need to create a SnipPlayer with the "new" keyword. And then include the SnipPlayer instance before the control functions: such as my_snip_player.snip_play(my_snip). Then include the SnipPlayer.step() in the Object's step event, and SnipPlayer.draw(...) to draw the SnipPlayer anywhere you want.
And that's a quick tutorial, I encourage you to check out the documentation and demo source code.
Documentation: https://docs.google.com/document/d/1JSGG1mfid8lOiSictlqFUEiaxrTep1TUyvLne1Z2Yr0
Marketplace Link: https://marketplace.yoyogames.com/assets/9275/aesnips-animation-system
GitHub repository including demo project and source code: https://github.com/angelwire/AESnips
Last edited: