Tell me more ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I am implementing car movement game (sort-of like Locomotion). So 60 times a second I have to advance the movement of each car. The problem is I have to look ahead to see if there is a slower car, stop sign, or red light ahead. And then slow down appropiately.

I also want to have the cars take time to go from stopped to full speed and again to slow down. I'm not implementing full-blown physics, but just a tick by tick speed up/slow down as that provides most of the realism to match what people expect to see.

The best I've come up with is to walk out the full distance the car would travel of it was slowing to a stop and see if anywhere along that path it needed to slow down or stop. And then move it forward appropiately.

I am moving the cars 60 times a second so I need this to be fast. And walking out that whole path each tick strikes me as processor intensive.

What's the best way to do this?

share|improve this question
Is this the same question? gamedev.stackexchange.com/questions/7963/… – Anko Dec 8 '12 at 1:14
Not really. A lot of that is path finding which I've got covered. As to the mechanics of moving down the road, it discusses the same issues but just talks about the ways to avoid collisions, but not the mechanics of moving down the path step by step. – David Thielen Dec 8 '12 at 4:24

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.