Rotation mouse follower with easing
I am terrible at math and am having an issue accomplishing my goal.
http://www.newgrounds.com/dump/item/6e5cde6c6b94de74119aac82c43312d2 - Example
It works just fine, but what im looking to do is have each object follow the rotation at different speeds. I want each MC to have "Easing"
I cant figure out how to make it rotate a little slower than the mouse itself. It follows just dead on, same speed that the mouse moves, it moves.
MovieClip linked to mcMouseFollower.as Class,
On my main Class I have the following:
package {
import flash.display.*;
import flash.events.Event;
public class MAIN extends MovieClip {
public var follower:mcMouseFollower;
public function MAIN () {
// constructor code
follower = new mcMouseFollower();
follower.x = stage.stageWidth / 2;
follower.y = stage.stageHeight / 2;
stage.addChild (follower);
stage.addEventListener (Event.ENTER_FRAME, frameLoop);
}
public function frameLoop (event:Event):void {
// find out mouse coordinates to find out the angle
var cy:Number = stage.mouseY - follower.y;
var cx:Number = stage.mouseX - follower.x;
var Radians:Number = Math.atan2(cy,cx);// find out the angle
var Degrees:Number = Radians * 180 / Math.PI;// convert to degrees to rotate
// rotate
follower.rotation = Degrees;
}
}
}