Results 1 to 1 of 1
Thread: Rotating image to mouse problem
- 10-05-2012, 10:55 PM #1Member
- Join Date
- Mar 2012
- Rep Power
Rotating image to mouse problem (Solved)
I'm making a tower defense game that is going to shoot a laser at a monster but I'm having a hard time aiming the tower towards the monster. I've been looking around for a code that will make this work but the only one i've found is "Math.toDegrees(Math.atan2(yEnd-yStart,xEnd-xStart))" and this is not working for me. The tower is rotating to much.
Here is a video demonstation:
Any help would be appreciated!
Take away Math.toDegrees made it work :D
Last edited by totalspelnerd; 10-05-2012 at 11:52 PM.
- By altosaxplayer88 in forum Java 2DReplies: 2Last Post: 06-01-2011, 02:36 AM
- By Leospaceman in forum Java 2DReplies: 2Last Post: 05-31-2011, 02:48 PM
- By VortexSpin in forum Java 2DReplies: 1Last Post: 02-13-2011, 06:54 AM
- By lackofcolor in forum Java 2DReplies: 3Last Post: 02-28-2009, 12:54 AM
- By sciguy77 in forum Java AppletsReplies: 9Last Post: 02-17-2009, 02:47 AM