Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I'd like to create a game where a car drives over a 2D terrain. Which algorithm to use so the car will follow the mountain incline?

share|improve this question
    
What exactly are you trying to achieve? Model the road, so that the car cannot drive off the road? What's the deal with the mountain? Is there anything special regarding the mountain, compared to a "regular" road? –  bummzack Nov 24 '11 at 11:03
    
its road you are right , im looking for way to drow aroad , then the car be able to drive . something like this : gamesfreak.net/games/4-Wheel-Madness_253.html –  user3689 Nov 24 '11 at 11:18
    
Google "Perlin noise" for terrain generation, as for the other part of the question, I really don't know. –  jco Nov 30 '11 at 11:11

1 Answer 1

up vote 3 down vote accepted

The game you linked to in your comment most likely uses a physics-engine like Box2D (flash port) for the car physics. So the basic steps are: Create a car body with connected wheels (use joints) and use either a procedural approach or a level editor to create the terrain.

The car following the terrain will be handled by the physics-engine if you set things up correctly.

share|improve this answer

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.