# Top down car

#1

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

0 Likes

#2

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

#3

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

0 Likes

#4

Set the gravity to 0! Magic.

0 Likes

#5

But then the car how will be considered dynamic?

0 Likes

#6

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

2 Likes

#7

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

#8

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

1 Like

#9

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

0 Likes

#10

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

1 Like

#11

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

#12

Well, the game is still live!

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

3 Likes