Pause in animation

BlitzPlus Forums/BlitzPlus Beginners Area/Pause in animation

mv333(Posted 2012) [#1]
In this thread, GfK told someone to use a float to slow down the frame rate. I used the code from the LoadAnimImage example in the docs, and replaced the timer with a float :



Why does frame 2 pause twice as long as frames 1 and 3?

Last edited 2012


Matty(Posted 2012) [#2]
Rounding - see below for details:

Global gfxSparks, frmSparks#, tmrSparks,frame%
Graphics 640,480,16
SetBuffer BackBuffer()
gfxSparks=LoadAnimImage("C:\Program Files\Blitz3D\samples\mak\insectoids\graphics\spark.bmp",32,32,0,3)
MaskImage gfxSparks,255,0,255

While Not KeyHit(1)
Cls

frmsparks = frmsparks + 0.01
If frmsparks > 2
  frmsparks = frmsparks - 2
EndIf

DrawImage gfxSparks,MouseX()-50,MouseY(),frmSparks
Text 0,0,frmSparks
frame = frmSparks
Text 0,15,frame
Flip
Wend 




mv333(Posted 2012) [#3]
Thanks, I wasn't familiar with rounding. Problem fixed :



Last edited 2012