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?
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…
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/180this._rotation)*speed);
}
[/AS]