The OTHER way - the way I'm trying to use is to use a timer for "anything" you manipulate, so things work the same way - using the highest frame rate the computer can do, but still give you the same exact game play - appearance - movement speeds etc. Like rather than figuring if you should move 1, 2 or 3... how about how much per millisec? if 10milliseconds elapsed since the last time thorugh the loop - move the object "ELAPSED MILLISECONDS" * DISTANCETOMOVE
I usually refer to Distance to Move as a SPEED thingy.
By having a loop go through all things you are tracking:
type rtMyMovableThings
id ` The # assigned to whatever...
iType ` image? sound? object
ithingtype ` Car Truck?
x# ` coords
y#
z#
xo# ` offset to position "correctly"
yo#
zo#
xv# ` Velocity (move each millisec)
yv#
zv#
iOldTime
endtype
Then in your loop you can move each object, and cam, whatever to its new place - store the info in this type (in an array) the last time ya did it, and have code to decide what its gonna do for each "thing" or Object or whatever.
(Vague... sorta - still trying to get solid codebase with it that's easy to manipulate various numbers of objects without overhead of tracking dynamic arrays or looping through a big hardcoded array that may have empty "slots" during game play....though timing would make game smooth if done this way cause timing code would balance it out)
-=/Jaze/=-