2d animations

Blitz3D Forums/Blitz3D Beginners Area/2d animations

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

I go one step further by keeping a linked list of "cells" for each "animation". Each cell describes how many frames to display an image for and where to find the image (I'm using quads so I store texture_id and uv co-ordinates, but anim image handle and frame index would work too.) Whenever I want a "sprite" (a game object, not a "Blitz Sprite") to start a new animation, I set the its animation cell pointer to the first node of the animation and reset its frame counter. My game loop automatically increments all sprites' frame counters by 1 and advances them to the next animation cell when required.