Car game

I am trying to build a car game. I’ve already made the landscape and the car but I need help figuring out how to make the controls and gravity and everything. Anybody have any suggestions :bulb:

Thank you in advance.

depends on how realistic the car shall behave. for a simple “i dont care if its realistic or not as long as it works” all you need is the landscape’s heigh at the point of your car, the slope of your landscape at that point, the speed of your car and a hand full of functions containing some common physic formulas for acceleration and the like.
you can extend the complexity as you like.adding more accurate collisions, steering, using forces, etc… up to a fully physic-based simulation using PhysX or ODE.

for beginners you should start with basic interaction. such as getting keyboard events. manipulate objects positions. then combining both.
once again the manual and the samples which come with panda are a great place to look at. the asteroid example, maybe the roaming ralph example might be of high interest for you. which doesnt mean you should skip the rest.

I think the best advice i can give is approach the problem incrementally.

For instance, first work on getting the car responding to simple controls; moving around in a game loop (probably a task); with incremental setPos, HP (probably not r) ect.

Roaming ralph example is good here, as well as just general foodling

Next, perhaps get collisions working with stuff on the track/scene and reactions happening accordingly.

manual is quite informative here;

Then once the car is moving around and what not, perhaps implement some kind of inertia; with which you can build some kind of basic physics modeling.

Etc etc.

If you are looking for something along realistic lines - be prepared for TONS of math. I would read up as much as possible on kinematics physics, which will likely be the basis of your game.

I think approaching it in segments not only makes it less (OMG SO MUCH TO DO), but also you can focus on learning different parts of panda for different sections of the game, thus not only resulting in a pretty cool project but resulting in you being pretty good with panda afterwards. :wink:

Thanks for all the help. I just didn’t know how to write the code for it or anything. :confused: