There are many ways to determine the mouse angle, the main method currently in use involves the use of sine lookup tables and lots of fairly complicated looking loops. What we all want is a fast easy way to determine the mouse angle. This method approximates the angle. The movement of a bullet from the origin to the mouse is also calculated, however this is exact.
Glossary of Terms
Origin - the spot where the mouse angle is relative to.
Normalisation - making two values sum to 1, whilst maintaining their relative proportions.
Quadrant - the direction of the mouse angle, for this tutorial they are:
up and left
up and right
down and left
down and right
|» Level Intermediate|
Rating: 7 Votes: 41
|No information about the author has been provided.|
|Download the files used in this tutorial.|
|Download (4 kb)|
|More help? Search our boards for quick answers!|