Top down car

My greetings to the community.
I want to make a top down game with platformer levels i don’t know anything about programming in general
The Lua from what i have seen so far is considered as an easy language to learn so i decided to go for it.
I want to know how to aproach car mechanics from where to start.
Do I should make a use of kinematic body for my car how to implement delta time? etc

Hello! The easiest option is to use a dynamic body and move it with impulses. This makes the car move and collide naturally. In a game I made I used a sprite with a slightly delayed rotation to simulate drift. This worked surprisingly well. Good luck!

1 Like

If the car is dynamic it will not falling to the -Y axis?
How we can manage that?

Set the gravity to 0! Magic.

But then the car how will be considered dynamic?

It still reacts to forces and impulses, just not gravity.

2 Likes

You can move dynamic bodies around by applying forces to them with the “apply_force” message. Even if there’s no gravity, the body will still be simulated. It will still collide with other bodies. You should definitely read the Physics manual and API reference.

I think there are a lot of different ways to do top-down cars, depending on how realistic you want it. I think you can google “2d car physics” and fine some decent explanations. I’ve never done this myself so I’m not much help, but if I was going to start experimenting, I would start with something like an Asteroids ship, and then add a force to simulate sideways friction.

2 Likes

Ok i have to test it and play with the settings thanks totebo for your time

1 Like

Ross this is a good idea i have to test it out thanks brother

Hi!
There is an example, a racer: Victory Lane - overhead car racing game bye @benjames171 :wink:

1 Like

Interesting approach! I would love to see a demo of this, do you still have it?

I have been meaning to create a top-down car game in Defold, but just can’t manage to get some good/fun “arcady” physics.

1 Like

Well, the game is still live! :slight_smile:

https://www.totebo.com/no-brakes

3 Likes