No Game Engine Game Dev: Word Sleuth 052: Sprite animation

4 months ago
22

Streamed on 2024-09-19 (https://www.twitch.tv/thediscouragerofhesitancy)

Game Engines are for sissies!

Today we started the last major feature: Sprite animation. There are two paths we could have taken, so of course we took both.
1) An array of textures
2) An array of UV coordinates into a single texture

I started by updating the asset pipeline to handle the sprite sequences a bit better. Once we were able to get all the data we needed from the ImageWarehouse it was time to create the thing itself. It is basically a texture quad, an array of "frames" (either of textures or of UVs), an EggTimer to let us know when to change the image, and in no time at all we had a spinnning coin animation.

There was a step to make things more robust and developer (me) friendly. Then it was on to adding some bells and whistles. At the end of a sequence it can take several actions: Stop (leaving the last image visible), Reset (Stop and show the first image), Repeat (start back over at frame 0) and Reverse (keep going, but count down from the current frame back to 0). On top of that I added a loop counter, so it will keep playing through with an implicit Repeat at the end of each collection of end-of-sequence actions until the loop count is reached.

There are only a couple of loose ends I want to tackle on Monday, then we will move on to the polishing phase.

Loading comments...