Animating sprites

Hi,

I'm looking for information about animating sprites.
For example:

  • Idle animation
  • Death Animation

Would love to know if there's a recommanded way on how to do it and how to load the images for it

thanks

Take a look at the SDK examples like Level 1-1.

The SDK provides this way:
https://sdk.play.date/inside-playdate/#_animation

Loading images for use with animation:
https://sdk.play.date/1.12.3/#C-graphics.imagetable

But there may be other, easier options:

Dustin made this extra:
https://devforum.play.date/t/lightweight-animatedimage-library/4500

WhiteBrim made this extra:
https://devforum.play.date/t/animated-sprite-helpful-class/1884

I just set the frame of the Sprite manually!

2 Likes

Here's documentation for my lib:

1 Like

Hi @Whitebrim , thanks for your lib! I'm using your library in my project and my player has 2 animations: idle and eat. When it collides with an object I use the changeStatus("eat") method but at the end of the animation I would like it to go back to idle (which is the default animation) but instead the player fizzes at the first frame and is no longer animated. How can I do?

Thanks in advance!

Hi! You should set "nextAnimation" to "idle" in the "eat" state.

Docs: Config parameters · Whitebrim/AnimatedSprite Wiki · GitHub
Example: Examples · Whitebrim/AnimatedSprite Wiki · GitHub

1 Like

Nice! It works! Thanks again :smiley:

1 Like