Computer Science Canada angle problem |
Author: | shoobyman [ Fri Dec 08, 2006 10:13 am ] | ||
Post subject: | angle problem | ||
If you click, the ship moves properly, but can anyone help me with the formula for the way the ship is facing? I want it to face the mouse, but I have tried a lot of different ways and i don't know how to do it. Anyone know the formula? ps. Code is messy, but don't worry about that |
Author: | zylum [ Fri Dec 08, 2006 3:56 pm ] |
Post subject: | |
this might help: http://www.compsci.ca/v2/viewtopic.php?t=14083 |
Author: | richcash [ Mon Dec 11, 2006 2:44 pm ] | ||
Post subject: | |||
I assume you mean something like this :
Get the angle and then use sine and cosine. In your case, you already have the rotated images, so you don't even have to use sine and cosine! Just draw the image that's at that angle. |