• Create Account

#Actualreppinfreedom

Posted 17 November 2012 - 09:37 PM

Can someone verify that this math is correct? If your traveling up or down on an isometric map the speed of the character should be half that of traveling horizontal. What I am not sure about is traveling at an angle. The character speed should be the horizontal and vertical speeds divided together correct? So 0.75. This will be multiplied times the actual character speed.

Hmmm... Going to go see if I can find some information on eight directional isometric character movement speeds...

[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.75; } else if (Angle == 90) { angleSpeed.Animation="u"; angleSpeed.Speed=0.5; } else if (Angle == 153) { angleSpeed.Animation="ur"; angleSpeed.Speed=0.75; } else if (Angle == 180) { angleSpeed.Animation="r"; angleSpeed.Speed=1; } else if (Angle == 206) { angleSpeed.Animation="dr"; angleSpeed.Speed=0.75; } else if (Angle == 270) { angleSpeed.Animation="d"; angleSpeed.Speed=0.5; } else if (Angle == 333) { angleSpeed.Animation="dl"; angleSpeed.Speed=0.75; } else { angleSpeed=null; } return angleSpeed; }[/source]

#2reppinfreedom

Posted 17 November 2012 - 09:31 PM

Can someone verify that this math is correct? If your traveling up or down on an isometric map the speed of the character should be half that of traveling horizontal. What I am not sure about is traveling at an angle. The character speed should be the horizontal and vertical speeds divided together correct? So 0.75. This will be multiplied times the actual character speed.

[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.75; } else if (Angle == 90) { angleSpeed.Animation="u"; angleSpeed.Speed=0.5; } else if (Angle == 153) { angleSpeed.Animation="ur"; angleSpeed.Speed=0.75; } else if (Angle == 180) { angleSpeed.Animation="r"; angleSpeed.Speed=1; } else if (Angle == 206) { angleSpeed.Animation="dr"; angleSpeed.Speed=0.75; } else if (Angle == 270) { angleSpeed.Animation="d"; angleSpeed.Speed=0.5; } else if (Angle == 333) { angleSpeed.Animation="dl"; angleSpeed.Speed=0.75; } else { angleSpeed=null; } return angleSpeed; }[/source]

#1reppinfreedom

Posted 17 November 2012 - 09:30 PM

Can someone verify that this math is correct? If your traveling up or down on an isometric map the speed of the character should be half that of traveling horizontal. What I am not sure about is traveling at an angle. The character speed should be the horizontal and vertical speeds divided together correct? So 0.75. This will be multiplied times the actual character speed.

[source lang="java"]public static function angleSpeedToNextRowCol(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.75; } else if (Angle == 90) { angleSpeed.Animation="u"; angleSpeed.Speed=0.5; } else if (Angle == 153) { angleSpeed.Animation="ur"; angleSpeed.Speed=0.75; } else if (Angle == 180) { angleSpeed.Animation="r"; angleSpeed.Speed=1; } else if (Angle == 206) { angleSpeed.Animation="dr"; angleSpeed.Speed=0.75; } else if (Angle == 270) { angleSpeed.Animation="d"; angleSpeed.Speed=0.5; } else if (Angle == 333) { angleSpeed.Animation="dl"; angleSpeed.Speed=0.75; } else { angleSpeed=null; } return angleSpeed; }[/source]

PARTNERS