I have been looking around for quite awhile trying to figure out how to get smooth animation. With every method I have tried for timing, I get jitters in movements. I have tried using vwait flip false, but that doesn't work. I have also tried using a timer with millisecs, but that also doesn't work. This code shows the problem well:
This code has boxes flying upwards, and on my computer their motion is very jerky. Anyone have any ideas? The jitters aren't as noticeable in full 3D, but my game is not like that.
Thanks.
Graphics3D 800,600 SetBuffer BackBuffer() camera=CreateCamera() MoveEntity camera,0,0,-10 light=CreateLight() MoveEntity light,0,0,-15 Type cube Field x#,y#,meshHandle End Type SeedRnd MilliSecs() While Not KeyHit(1) timer=timer+1 If timer>14 Then timer=0 If timer=0 Then a.cube= New cube a\meshHandle=CreateCube() a\x=Rnd(-4,4) a\y=-10 EndIf For a.cube=Each cube a\y=a\y+0.2 PositionEntity a\meshHandle,a\x,a\y,0 If a\y>15 Then Delete a Next UpdateWorld RenderWorld Flip Wend End
This code has boxes flying upwards, and on my computer their motion is very jerky. Anyone have any ideas? The jitters aren't as noticeable in full 3D, but my game is not like that.
Thanks.