Page 1 of 1

360 degree 2d rotating

PostPosted: Tue Feb 13, 2007 3:51 pm
by Troodon
Hi guys and ladies!
I'm working on a game where you move 360 degrees and I used the code from the old asteroids demo. However I need to use the velocity = 0 in key up. And when I again start moving the animation and the direction aren't synced anymore. Someone can help me?

PostPosted: Tue Feb 13, 2007 10:50 pm
by makslane
The angle is calculated based on the x and y velocity.
So, if velocity is 0, the angle is unknown.
To solve this, just use a second variable to hold the current angle.

PostPosted: Wed Feb 14, 2007 6:11 pm
by Troodon
Ok, thanks! I'll try that.
By the way is there already a demo demostrating it?
If there is I could use it, if no I will find out myself. :D