# \[fmx\] travel in direction of rotation

**URL:** <https://forum.kirupa.com/t/fmx-travel-in-direction-of-rotation/20915>\
**Category:** flash\
**Created:** [May 14, 2003, 5:55pm UTC](https://forum.kirupa.com/t/fmx-travel-in-direction-of-rotation/20915 "2003-05-14T17:55:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tgelston](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/tgelston/32/54_2.png) [@tgelston](https://forum.kirupa.com/u/tgelston)\
**Post date:** [May 14, 2003, 5:55pm UTC](https://forum.kirupa.com/t/fmx-travel-in-direction-of-rotation/20915/1 "2003-05-14T17:55:09Z")

</div>

Hi!  
I have a MC(a small army tank) that I can rotate using the right and left buttons. I want to make it move forward when I push the up arrow - The Catch . . . I want it to move in the same direction it is currently rotated. Example: I rotate the tank 10 degrees and then I push the up arrow off it goes in that direction.

How?

I saw an increadible trig tutorial written by senocular but I am sorry to say that was way over my head. I am hoping that the solution is fairly simple?

Thanks in Advance!

Tobias  
[http://www.gelstoncafe.com](http://www.gelstoncafe.com)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 14, 2003, 5:58pm UTC](https://forum.kirupa.com/t/fmx-travel-in-direction-of-rotation/20915/2 "2003-05-14T17:58:14Z")

</div>

I’m sure that the way Sen showed was one of the easiest most efficient ways to achieve such an effect. Re-read the tutorial or post a link and maybe I can help explain it…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 15, 2003, 12:35am UTC](https://forum.kirupa.com/t/fmx-travel-in-direction-of-rotation/20915/3 "2003-05-15T00:35:24Z")

</div>

Jubba - thanks for the offer to explain. The tut I was refering to is posted in the “best of Kirupa” forum - I think it is called moving vectors. Any way I found what I was looking for.

[AS]  
if (Key.isDown(Key.RIGHT)) {  
this.\_rotation += 10;  
} else if (Key.isDown(Key.LEFT)) {  
this.\_rotation -= 10;  
} else if (Key.isDown(Key.UP)) {  
this.\_x += (Math.cos(Math.PI/180\*this.\_rotation)_speed);  
this.\_y += (Math.sin(Math.PI/180_this.\_rotation)\*speed);  
}  
[/AS]

Thanks,  
Tobias  
[http://www.gelstoncafe.com](http://www.gelstoncafe.com)
