Results 1 to 1 of 1
  1. #1
    totalspelnerd is offline Member
    Join Date
    Mar 2012
    Rep Power

    Default 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-06-2012 at 12:52 AM.

Similar Threads

  1. Image Rotating Around Mouse
    By altosaxplayer88 in forum Java 2D
    Replies: 2
    Last Post: 06-01-2011, 03:36 AM
  2. Help with Image Rotating?
    By Leospaceman in forum Java 2D
    Replies: 2
    Last Post: 05-31-2011, 03:48 PM
  3. Rotating Buffered Image distorts image
    By VortexSpin in forum Java 2D
    Replies: 1
    Last Post: 02-13-2011, 06:54 AM
  4. Rotating an image
    By lackofcolor in forum Java 2D
    Replies: 3
    Last Post: 02-28-2009, 12:54 AM
  5. Rotating Image?
    By sciguy77 in forum Java Applets
    Replies: 9
    Last Post: 02-17-2009, 02:47 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts