Animated Sprite.

Blitz3D Forums/Blitz3D Programming/Animated Sprite.

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.

Whats the problem with doing that? You need to decide how long the animation should last, and then divide this by the amount of frames. Eg:

animstrip = loadanimtexture("texture", 1, 128, 128, 0, 9)
spr = createsprite()
entitytexture spr, animstrip
time = 9 / 3000   ; animation lasts 3 seconds
currentframe = 0
animtime = millisecs()

while not keyhit(1)
    cls
    if millisecs() > animtime + time
        currentframe = currentframe + 1
        animtime = millisecs()
    endif
    flip
wend


Of course, you would want to make that auto update able, putting it into functions etc. Hope that helps anyway!