What does this mean for me? You will always be able to play your favorite games on Kongregate. However, certain site features may suddenly stop working and leave you with a severely degraded experience.
What should I do? We strongly urge all our users to upgrade to modern browsers for a better experience and improved security.
We suggest you install the latest version of one of these browsers:
Kongregate is a community-driven browser games portal with an open platform for all web games.
Get your games in front of thousands of users while monetizing through ads and virtual goods.
Learn more »
This will turn mc towards the mouse by a maximum of 5. This assumes the mc is drawn facing the right. If it’s facing up, just add 90 to angle.
// Find the angle towards the mouse
var angle:Number = Math.atan2(mc._parent._ymouse - mc._y, mc._parent._xmouse - mc._x) * 180 / Math.Pi;
var difference:Number = angle - mc._rotation;
// Make sure the difference is between -180 and 180 so it can be limited easily
if (difference < -180) difference += 360;
if (difference > 180) difference -= 360;
// Limit the movement to 5 in either direction
difference = Math.max(-5, Math.min(5, difference));
mc._rotation += difference;