# Inertia with a car

**URL:** <https://forum.kirupa.com/t/inertia-with-a-car/323809>\
**Category:** Uncategorized\
**Created:** [July 19, 2011, 1:05pm UTC](https://forum.kirupa.com/t/inertia-with-a-car/323809 "2011-07-19T13:05:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jrme421](https://avatars.discourse-cdn.com/v4/letter/j/46a35a/32.png) [@jrme421](https://forum.kirupa.com/u/jrme421)\
**Post date:** [July 19, 2011, 1:05pm UTC](https://forum.kirupa.com/t/inertia-with-a-car/323809/1 "2011-07-19T13:05:21Z")

</div>

ok i’ve spent lots of hours looking up the internet trying many techniques but nothing do. i just want to add inertia to my car. i know there are tutorials and i did try to adapt them but still nothing if someone could help me that would be really great thanks

var car:Car = new Car();  
var power = 10;  
addChild(car);  
car.x = 470;  
car.y = 200;  
var dx = 0;  
var dy = 0;  
stage.addEventListener(KeyboardEvent.KEY\_DOWN, keyhandler);  
function keyhandler(event:KeyboardEvent):void  
{  
switch(event.keyCode)  
{  
case Keyboard.LEFT :  
car.x -= power \* force.x;  
break;

```
 case Keyboard.RIGHT : 
car.x += power;

```

break;

case Keyboard.UP :  
car.y -= power;  
break;

case Keyboard.DOWN :  
car.y += power;  
break; }  
}
