Hi Cara, It does. Thanks for that code snip. I had never thought about structuring my main loop quite like that. I'll have to try that sometime.
Cheers! On 8/19/13, Cara Quinn <[email protected]> wrote: > Hi Thomas, just a quick one for now as I'm super sleepy. > > Yes, this is essentially correct but way over simplified. > > What I mean is this: > > while (running) > { > > // Update player movement and position > UpdatePosition(); > > // Get input > > getPlayerInput(); > > // process physics > > processPhysics(); > > // Update collision detection > UpdateCollision(); > > // Sleep for x MS > Sleep(time); > } > If you notice, the first time through the loop, the entities are being > rendered immediately. Every time after that they are actually being rendered > after the collision detection is processed. So the input is taken into > account and the physics are processed, then the collision detection. After > that is done then the entities are rendered in their new positions. So you > can keep the movement methods separate and still have the benefit of > collision detection preventing you from going into walls and such. > > Hope this makes sense and have a great night! Yawn!… :) > > Smiles, > > Cara :) --- Gamers mailing list __ [email protected] If you want to leave the list, send E-mail to [email protected]. You can make changes or update your subscription via the web, at http://audyssey.org/mailman/listinfo/gamers_audyssey.org. All messages are archived and can be searched and read at http://www.mail-archive.com/[email protected]. If you have any questions or concerns regarding the management of the list, please send E-mail to [email protected].
