I’m not really good at this math stuff. anyone know how to move your mc according to your rotation using this AS? thanks in advance
adjacent = _root._xmouse-this._x;
opposite = this._y-_root._ymouse;
hypotenuse = ((adjacent ^ 2)+(opposite ^ 2)) ^ 0.5;
if (adjacent>0 && opposite>0) {
this._rotation = 90-Math.atan2(opposite, adjacent)*(180/Math.PI);
}
if (adjacent>0 && opposite<0) {
this._rotation = 90-Math.atan2(opposite, adjacent)*(180/Math.PI);
}
if (adjacent<0 && opposite<0) {
this._rotation = 90-Math.atan2(opposite, adjacent)*(180/Math.PI);
}
if (adjacent<0 && opposite>0) {
this._rotation = 90+(360-Math.atan2(opposite, adjacent)*(180/Math.PI));
}