# Physics Thrust Problem

**URL:** <https://forum.kirupa.com/t/physics-thrust-problem/317472>\
**Category:** flash\
**Created:** [December 22, 2010, 1:01am UTC](https://forum.kirupa.com/t/physics-thrust-problem/317472 "2010-12-22T01:01:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rimacy](https://avatars.discourse-cdn.com/v4/letter/r/839c29/32.png) [@rimacy](https://forum.kirupa.com/u/rimacy)\
**Post date:** [December 22, 2010, 1:01am UTC](https://forum.kirupa.com/t/physics-thrust-problem/317472/1 "2010-12-22T01:01:51Z")

</div>

Right now when i push thrust(up arrow) i want to go up what I’m getting is movement from right to left as if my thruster were rotated around to the side of my ship which of course won’t do…can anyone see the prob with the code???

```auto
public function moveShip():void
        {   
            
            rotation += rVel;//right and left keys add or subtract to rVel
            var angle:Number=rotation*Math.PI/180;
            
            yAcc=Math.sin(angle) * thrust+gravity;//thrust+gravity;
            xAcc=Math.cos(angle) * thrust;
            yVel-=yAcc;
            xVel-=xAcc;
            yVel =yVel*.98;
            rVel -=rVel*.25;
            
        }

```
