# Top down car

**URL:** <https://forum.defold.com/t/top-down-car/56627>\
**Category:** Questions\
**Created:** [July 3, 2019, 9:41pm UTC](https://forum.defold.com/t/top-down-car/56627 "2019-07-03T21:41:33Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![dark.helios.games](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/dark.helios.games/32/16864_2.png) [@dark.helios.games](https://forum.defold.com/u/dark.helios.games)\
**Post date:** [July 3, 2019, 9:41pm UTC](https://forum.defold.com/t/top-down-car/56627/1 "2019-07-03T21:41:33Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![totebo](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/totebo/32/36087_2.png) [@totebo](https://forum.defold.com/u/totebo)\
**Post date:** [July 3, 2019, 10:45pm UTC](https://forum.defold.com/t/top-down-car/56627/2 "2019-07-03T22:45:46Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![dark.helios.games](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/dark.helios.games/32/16864_2.png) [@dark.helios.games](https://forum.defold.com/u/dark.helios.games)\
**Post date:** [July 3, 2019, 11:32pm UTC](https://forum.defold.com/t/top-down-car/56627/3 "2019-07-03T23:32:11Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![totebo](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/totebo/32/36087_2.png) [@totebo](https://forum.defold.com/u/totebo)\
**Post date:** [July 4, 2019, 12:03am UTC](https://forum.defold.com/t/top-down-car/56627/4 "2019-07-04T00:03:19Z")

</div>

Set the gravity to 0! Magic.

---

<div class="post-metadata">

**Author:** ![dark.helios.games](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/dark.helios.games/32/16864_2.png) [@dark.helios.games](https://forum.defold.com/u/dark.helios.games)\
**Post date:** [July 4, 2019, 12:04am UTC](https://forum.defold.com/t/top-down-car/56627/5 "2019-07-04T00:04:56Z")

</div>

But then the car how will be considered dynamic?

---

<div class="post-metadata">

**Author:** ![totebo](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/totebo/32/36087_2.png) [@totebo](https://forum.defold.com/u/totebo)\
**Post date:** [July 4, 2019, 12:06am UTC](https://forum.defold.com/t/top-down-car/56627/6 "2019-07-04T00:06:19Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ross.grams](https://forum-defold.b-cdn.net/letter_avatar_proxy/v4/letter/r/cab0a1/32.png) [@ross.grams](https://forum.defold.com/u/ross.grams)\
**Post date:** [July 4, 2019, 12:06am UTC](https://forum.defold.com/t/top-down-car/56627/7 "2019-07-04T00:06:47Z")

</div>

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](https://www.defold.com/manuals/physics/) and [API reference](https://www.defold.com/ref/physics/).

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.

---

<div class="post-metadata">

**Author:** ![dark.helios.games](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/dark.helios.games/32/16864_2.png) [@dark.helios.games](https://forum.defold.com/u/dark.helios.games)\
**Post date:** [July 4, 2019, 12:07am UTC](https://forum.defold.com/t/top-down-car/56627/8 "2019-07-04T00:07:44Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dark.helios.games](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/dark.helios.games/32/16864_2.png) [@dark.helios.games](https://forum.defold.com/u/dark.helios.games)\
**Post date:** [July 4, 2019, 12:09am UTC](https://forum.defold.com/t/top-down-car/56627/9 "2019-07-04T00:09:05Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Pawel](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/pawel/32/24623_2.png) [@Pawel](https://forum.defold.com/u/Pawel)\
**Post date:** [July 4, 2019, 5:38am UTC](https://forum.defold.com/t/top-down-car/56627/10 "2019-07-04T05:38:52Z")

</div>

Hi!  
There is an example, a racer: [Victory Lane - overhead car racing game](https://forum.defold.com/t/victory-lane-overhead-car-racing-game/2847) bye @benjames171 😉

---

<div class="post-metadata">

**Author:** ![sven](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/sven/32/1086_2.png) [@sven](https://forum.defold.com/u/sven)\
**Post date:** [July 5, 2019, 12:18pm UTC](https://forum.defold.com/t/top-down-car/56627/11 "2019-07-05T12:18:16Z")

</div>

> [@totebo](#):
>
> 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!

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.

---

<div class="post-metadata">

**Author:** ![totebo](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/totebo/32/36087_2.png) [@totebo](https://forum.defold.com/u/totebo)\
**Post date:** [July 5, 2019, 12:37pm UTC](https://forum.defold.com/t/top-down-car/56627/12 "2019-07-05T12:37:01Z")

</div>

> [@sven](#):
>
> I would love to see a demo of this, do you still have it?

Well, the game is still live! 🙂

[Niclas Åberg - No Brakes](https://www.totebo.com/no-brakes)
