PHP Code:
<?php
$movement_speed = 0.5;
$server_speed = 32;
$unit_speed = 720;
$x1 = ;
$y1 = ;
$x2 = ;
$y2 = ;
function calc_dist($x1,$y1,$x2,$y2){
$a = $x1 - $x2;
$b = $y1 - $y2;
$dist = sqrt(($a*$a)+($b*$b));
return $dist;
}
$distance = calc_dist($x1,$y1,$x2,$y2);
$time = (($distance * $unit_speed)/$movement_speed)/$server_speed;
function minutes( $seconds ){
return sprintf( "%02.2d:%02.2d", floor( $seconds / 60 ), $seconds % 60 );
}
echo minutes($time);
?>
527|527 attack 525|524
My time: 02:42
Server time: 02:52
527|527 attack 525|523
My time: 03:21
Server time: 03:37