I finally finished my animated sprite library, with behavior.
Felicia now jumps like a frog using this code
void Felicia_update( struct AnimatedSprite *felicia ) { if (felicia->curFrame<2) return; if (felicia->curFrame>6) return; felicia->x++; felicia->x %= 320; } int main( ) { struct AnimatedSprite *animFelicia; Anim_Init(); animFelicia = Anim_New(FELICIA_ANIM, &felicia, 1, 10, 70, PAL1 ); Anim_LoadPal(animFelicia); Anim_SetBehavior(animFelicia, &Felicia_update); while(1) { Anim_Update(); } }
Note this demo is now using the last version of Stef’s GenDevKit