Skip to content

Instantly share code, notes, and snippets.

@slaskis
Created August 28, 2009 10:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save slaskis/176891 to your computer and use it in GitHub Desktop.
Save slaskis/176891 to your computer and use it in GitHub Desktop.
// Source and tile size (can the tile size be adjusted if needed?)
var t = new TileMap( source , 64 , 64 );
t.add( "rot" , Rotation( 180 ) , 60 ); // a rotation of 180 degrees over 60 frames
t.add( "scale" , Scale( 4 ) , 12 ); // a scale by 4x over 12 frames
// t now has 71 frames (one is always the same for every effect, the original, which is reused)
t.get( "rot" , 1 ); // Fetches the first frame of the rotation effect
t.add( "rotscale" , Combine( [ Rotation( 180 ) , Scale( 4 ) ] ) , 60 ); // a scale by 4 and rotation of 180 degrees over 60 frames
t.remove( "rot" );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment