|
|
"One way to make an object revolve around another one in circles with the mouse(Turret aiming?)", by grim_1_2_3
|
This code will move the object (The word "hello" in this case) around another object (The word "Ship" in this case) in a perfect circle whenever you move the mouse up or down. It revolves either left or right depending on which direction you move the mouse. Anyway, One good use for this code would be for say, Aiming a gun turret in a shoot-em-up style game such as R-type. Anyway, If this doesn't make much sense, Just run the code and you will see how it works.
No images are required.
Please note: The sin/cos tables haven't been pre-calculated in this code, So it might run a 'tiny' bit slow if you have a slow computer. Anyway, I will eventually add that to the code, with comments. |
| Code | | | |