Help with game development. Render loop?

Posted by John on Stack Overflow See other posts from Stack Overflow or by John
Published on 2010-05-06T20:18:30Z Indexed on 2010/05/06 22:18 UTC
Read the original article Hit count: 344

Hello, I'm working on a simple game, this is my first game project.

Most of the samples I find have a Render Loop where all the game logic is made too and I just don't like this. Let's say I have a ball with X=0, and a wall in X=10 and in a slow machine, the first loop places the ball in X=7 and in a second loop, it places the ball in X=14. It would just crash the game!

Is this "render loop" the right way to make games? Should I write code to check for things like this in every frame? Example, new frame X=14, last frame have X=7, so I should check if there's anything from X=7 to X=14??

I was thinking that I should have a separated thread for the game logic and in the render loop, I should just "take a snapshot" of the current game logic and display that, no?

How do you guys, experienced game developers work around this?

thanks!

© Stack Overflow or respective owner

Related posts about game-development

Related posts about game-engine