360 degree 2d rotating

Talk about making games.

360 degree 2d rotating

Postby Troodon » Tue Feb 13, 2007 3:51 pm

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?
I can't die, I already tried
~on the forums since GE 1.3.3~
User avatar
Troodon
 
Posts: 1539
Joined: Thu Jan 12, 2006 3:29 pm
Location: HELL
Score: 56 Give a positive score

Postby makslane » Tue Feb 13, 2007 10:50 pm

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.
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby Troodon » Wed Feb 14, 2007 6:11 pm

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
I can't die, I already tried
~on the forums since GE 1.3.3~
User avatar
Troodon
 
Posts: 1539
Joined: Thu Jan 12, 2006 3:29 pm
Location: HELL
Score: 56 Give a positive score


Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest