Animated Sprite.

Blitz3D Forums/Blitz3D Programming/Animated Sprite.

Iv seen in the past some code, possibly in the archives, that used a quad or sprite and an animstrip to create a 3D animated sprite explosion.

Im wondering if there is any examples of this still floating around. I cant seem to find it or remember where it was I saw it.

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!

erm that didnt work.

got it.

Sorry yavin, i was away from blitz and unable to ttest, good to hear its working now though xD