PDA

Click to See Complete Forum and Search --> : Animation Speed


bff
Mar 14th, 2001, 12:22 PM
Hi. In my program i want a man to walk across the screen. But when he does the animation is too fast how can i make it so the framenumber goes up by 65 every 10 pixels.

Fox
Mar 14th, 2001, 12:45 PM
use GetTickCount

see my site for examples

Sastraxi
Mar 14th, 2001, 06:21 PM
Do you mean the milliseconds between the frames? Or do you mean the array of bitmaps? If its the first one (I think it is, at least) here is the code:


'PRIVATE declaration for GetTickCount API here.
Dim X
Dim MS
Dim LastFrameNum as long

Sub Form_Load
MS=100
X=0
End Sub

Sub AnimateGUY(MSS)
X=X+1
If X mod 10 = 0 then ms=ms+65
IF gettickcount - mss => ms then
'code for animating guy here, use X as the X number and whatever you want for the Y number.
lastframenum=mss
end if
End Sub



Usage: AnimateGUY GetTickCount
This will work, I hope!

I'm only an email away - Sastraxi