Ludum Dare 35
The Theme is:
Shapeshift

Judging ends in
Click here to start

PlayRate80Star

Thanks everyone for coming out! For the next 3 weeks, we’ll be Playing and Rating the games you created.
You NEED ratings to get a score at the end. Play and Rate games to help others find your game.
We’ll be announcing Ludum Dare 36’s August date alongside the results.

Looking good, but i have a problem!

Posted by (twitter: @petterroea)
December 17th, 2011 8:14 am

Yup. I need the player, at a constant coordinate of 400, 300, to face the mouse. And i suck at stuff like this? Any help?

rotation degrees = 0 when facing right. Up is 270. ect…


2 Responses to “Looking good, but i have a problem!”

  1. delpes says:

    float radiansToMouse = (float) Math.atan2(400 – input.getMouseX(), 300 – input.getMouseY());
    float degreesToMouse = (57.2957795f * radiansToMouse) * -1;
    heroImage.setRotation(degreesToMouse);

    Something like this?

  2. petterroea says:

    Yes, thanks! You saved my day!

Leave a Reply

You must be logged in to post a comment.

[cache: storing page]