Skip to content

Instantly share code, notes, and snippets.

@demonixis
Created May 19, 2012 20:45
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 demonixis/2732324 to your computer and use it in GitHub Desktop.
Save demonixis/2732324 to your computer and use it in GitHub Desktop.
Yna Framework Animations
public SpriteState()
{
sonicSprite = new Sprite(new Vector2(50, 50), "2d//soniclg4");
sonicSprite.LoadContent();
sonicSprite.PrepareAnimation(50, 41);
sonicSprite.AddAnimation("down", new int[] { 0, 1, 2, 3 }, 25, false);
sonicSprite.AddAnimation("left", new int[] { 4, 5, 6, 7 }, 25, false);
sonicSprite.AddAnimation("right", new int[] { 8, 9, 10, 11 }, 25, false);
sonicSprite.AddAnimation("up", new int[] { 12, 13, 14, 15 }, 25, false);
sonicSprite.Play("up");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment