How to animate an image?

Blitz3D Forums/Blitz3D Beginners Area/How to animate an image?

Mr.Bob94(Posted 2005) [#1]
Hello all,
I'm pretty new to BB and I would like to know if anyone could tell me what I'm doing wrong here? The program runs but the image dosen't animate...
;test animation of image...
Global img,timer,frame
;graphics
Graphics 1024,768,0,2
SetBuffer BackBuffer()
;begin image load
img = LoadAnimImage ("thrasher.bmp",32,32,0,3)
;begin loop
While Not KeyHit(1)
Cls
If MilliSecs() > timer + 100 Then
timer = MilliSecs()
frame = (frame = 1) Mod 3
End If
DrawImage img,0,0,frame
Flip
Wend
Thanks...


Baystep Productions(Posted 2005) [#2]
Next time use the...

[ code ]
[ /code ]
(minus spaces)


And, Im not sure, sometimes the ( & ) are picky on the DrawImage Part,

and "frame = (frame = 1) Mod 3" doesn't make any sense to me.

maybe you ment "frame = (frame+1) Mod 3"?


WolRon(Posted 2005) [#3]
Yep, looks like his plus sign became an equal sign.

btw, What are the forum codes?


Mr.Bob94(Posted 2005) [#4]
Okay... I must have missed the equals sign...