Quote:
it seems that this code is framerate dependent, no ?
Yes, currently is framedependent, i have to fix it.
Quote:
How do you plan your API to move sprites ? Change animation ?
I'm working on animation blocks/groups.
The idea is something like:
Each sprite file will have a name variable for each frame. More than one frame can have the same name, but the frames with the same name has to be together.
So if i call raydium_sprite_show_animation(spriteID,"walking_right") All the frames called "walking_right" will be looping until a new group of animation be selected.
Also i think a variable "loop" per frame (default to 1) will allow the animation in loop mode, but if it's set to 0, then the animation will stop in that frame until a new group is selected. If a variable "jump" is different to NULL then the animation will automatically jump to the indicated animation group. For example the animation "getting_up" always will be followed by the animation "stand".
Also i'll have to add a flags system to allow the programmer to know how is going the animation.
The sprite file will look like:
Code:
coords={0.0,0.1,0.2,0.3}
texture="filename.tga"
group="getting_up"
loop=1
jump=0
coords={0.4,0.4,0.5,0.5}
texture="filename.tga"
group="getting_up"
loop=1
jump="stand"