In my game Eclise, the turning code looks like this:
if shouldTurnLeft then
curTurn = curTurn + turnRate
elseif shouldTurnRight
curTurn = curTurn - turnRate
else
curTurn = curTurn - (turnRate * sign(curTurn)) //move curTurn
towards 0
end if
ship.turn(curTurn)
This makes the turning nice and smooth, because you don't move directly
from stopped to full turn.
I want to make this time based, not frame based.
My question is, should it be:
curTurn = curTurn + turnRate * dt
or
ship.turn(curTurn *dt)
or does it not make a difference?
Asher Dunn
--------------------------------------------------------
President and Head Developer of Fireye Software
<http://www.fireyesoftware.com/>
Make PDFs from your RB app
<http://www.fireyesoftware.com/code/pdfclasses/>
AIM and Yahoo: fireye7517
REALbasic 5.5.3 Mac OS X 10.3.5
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
|