Brucey, sounds like you got a solution.
Let me post the code guys, i hope this clarifies things.
and for tweening
here is the ticker class
Let me post the code guys, i hope this clarifies things.
'main loop Local execution_time:Float = 0 Local t:Int = MilliSecs() While Not (KeyHit(KEY_ESCAPE) Or AppTerminate() Or cancel) execution_time:+(MilliSecs() - t) t = MilliSecs() console.Listen() While execution_time >= update_time _Update() UPS.Update() execution_time:- update_time Wend _Render(execution_time / update_time) FPS.Update() Wend
and for tweening
Function _Update() player.vx = player.x + Cos(player.angle) * (player.speed * 32) / (1000.0 / Float(update_time)) player.vy = player.y - Sin(player.angle) * (player.speed * 32) / (1000.0 / Float(update_time))
Function _Render(tween:Float) Local tx:Int = Int(player.x * tween + player.oldx * (1.0 - tween)) Local ty:Int = Int(player.y * tween + player.oldy * (1.0 - tween))
here is the ticker class
Type TTicker Field count:Int Field timeout:Float = 1 Field timer:Float Field counter:Int Method update() If Self.timer < MilliSecs() Self.timer = MilliSecs() + (Self.timeout * 1000) Self.count = Self.counter Self.counter = 0 Else Self.counter:+1 End If End Method End Type