realbasic-games
[Top] [All Lists]

Re: Time based movement

To: REALbasic Games <realbasic-games at lists dot realsoftware dot com>
Subject: Re: Time based movement
From: Daniel Lurie <dl1021 at optonline dot net>
Date: Sun, 26 Dec 2004 09:17:58 -0500
Delivered-to: realbasic-games at lists dot realsoftware dot com
References: <D84533F8-5139-11D9-B4DD-000A95DB6C90 at fireyesoftware dot com> <B549BB36-56ED-11D9-AEA1-000A95DB6C90 at fireyesoftware dot com>

On Dec 25, 2004, at 10:24 PM, Asher Dunn wrote:


On Dec 18, 2004, at 4:14 PM, Asher Dunn wrote:

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?

Does no one have an answer to this?

Asher Dunn

If curturn is the ship's heading then it should be:

curturn=curturn+turnrate*dt

THEN

ship.turn(curturn*dt)



============
Daniel R. Lurie
============
http://www.vikingdan.com

_______________________________________________
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>

<Prev in Thread] Current Thread [Next in Thread>