Aha... Viola! Now this should be correct in converting xyVel into a velocity and an angle... Now I should be able to solve it.

[source lang="java"] public static function xyVelToVelAngle(xyVel:Point):Object { var velAngle:Object = new Object(); var Angle:Number = Math.atan2(xyVel.y,xyVel.x); var Degrees:Number = 360 * (Angle / (2 * Math.PI)); if (Degrees < 0) { Degrees = Degrees + 360; } velAngle.Angle = Degrees-180; velAngle.Vel = Math.sqrt(xyVel.x * xyVel.x + xyVel.y * xyVel.y); return velAngle; }[/source]

Edit: Changed "velAngle.Angle = Degrees" to "velAngle.Angle = Degrees-180"... Now correct!

Those functions were a little funky... This should be more proper and readable.

[source lang="java"] public static function xyVelToVelAngle(xyVel:Point):Object { var velAngle:Object = new Object(); var Angle:Number = Math.atan2(xyVel.y,xyVel.x); var Degrees:Number = radToDeg(Angle); velAngle.Angle = Degrees; velAngle.Vel = Math.sqrt(xyVel.x * xyVel.x + xyVel.y * xyVel.y); return velAngle; } public static function angleBetweenPoints(Location:Point, Target:Point):Number { var dx:Number = Location.x - Target.x; var dy:Number = Location.y - Target.y; var Angle:Number = Math.atan2(dy,dx); var Degrees:Number = radToDeg(Angle); return Degrees; } public static function radToDeg(Radian:Number):Number { return Radian * 180 / Math.PI; } public static function degToRad(Degree:Number):Number { return Degree * Math.PI / 180; }[/source]

Ok, this is what I came up with...

[source lang="java"]public static function animationAndSpeedToNextRowCol(currentRowCol:Object, nextRowCol:Object, tileSizeX:int, tileSizeY:int):Object { var angleSpeed:Object = new Object(); var Angle:int=Math.floor(gameMath.angleBetweenPoints(rowColToPoint(currentRowCol,tileSizeX,tileSizeY),rowColToPoint(nextRowCol,tileSizeX,tileSizeY))); if (Angle == 0) { angleSpeed.Animation="l"; angleSpeed.Speed=1; } else if (Angle == 26) { angleSpeed.Animation="ul"; angleSpeed.Speed=0.707; } else if (Angle == 90) { angleSpeed.Animation="u"; angleSpeed.Speed=0.5; } else if (Angle == 153) { angleSpeed.Animation="ur"; angleSpeed.Speed=0.707; } else if (Angle == 180) { angleSpeed.Animation="r"; angleSpeed.Speed=1; } else if (Angle == -154) { angleSpeed.Animation="dr"; angleSpeed.Speed=0.707; } else if (Angle == -90) { angleSpeed.Animation="d"; angleSpeed.Speed=0.5; } else if (Angle == -27) { angleSpeed.Animation="dl"; angleSpeed.Speed=0.707; } else { angleSpeed=null; } return angleSpeed; }[/source]

Edit: Ok... I finally managed to run a test that generated the numbers for me... These are the final multipliers simplified to four decimals of accuracy.

Sideways: 1.4142

Angle: 1.118

Up/Down: 0.7071

**Edited by reppinfreedom, 18 November 2012 - 03:52 AM.**