r/gamemaker • • 2d ago

Resource GameMaker Animator : light weight object to help manage sprite sheet based animations

Hey!

I'm working on a series of modular functions that are meant to work a bit like components : just add it to an object and it does it's magic!

The first one is Animator, which allows you to create and name animation presets, making it easy to write and read them in your code.

Here's what the gist of it look (Create event of a Game Maker object) :

// CREATE THE ANIMATOR COMPONENT
anim = new comp_animator( id );

// CREATE ANIMATION PRESETS
anim.create_anim( "walk",       1, 6 );
anim.create_anim( "run_normal", 7, 12 );
anim.create_anim( "run_fast",   7, 12, true, 2 );
anim.create_anim( "combat",     13, 18 );
anim.create_anim( "combo",      20, 30, false );

// SELECT AN ANIMATION TO PLAY
anim.play( "walk" );
  • Start by creating the object in a reference variable.
  • Create and name your animation presets.
  • Simply call presets with the "play( )" function to start using them!
  • The only thing left to do is to call the "update( )" function in the Step event of the object.

Animator can be used with a single or multiple sprite sheets. You can set your animations to loop or not (in which case they will stop at the last frame). You can adjust the speed and even enter a negative speed value to have the animations play backward.

Animator Demo

It's also 100% free! Let me know if you take a look. I'd be happy to know what your think.

Animator on itch

9 Upvotes

2 comments sorted by

2

u/OrnerySorceries 2d ago

Very cool! Getting 404 on your itch link though

1

u/KevinTrep 2d ago

Doh! Forgot to make it public. Should work now! Thanks.