ScriptCore3.Distance

From Soldat Community Wiki
Jump to: navigation, search
function Distance(X1, Y1, X2, Y2: Single): Single;

Parameter Info:
 X1 (Single): X coordinate of first coordinate.
 Y1 (Single): Y coordinate of first coordinate.
 X2 (Single): X coordinate of second coordinate.
 Y2 (Single): Y coordinate of second coordinate..

Description:
 Returns the distance between two points.
   

Examples

var Dist: Single;
begin
    Dist := Distance(Players[1].X,Players[1].Y,Players[2].X,Players[2].Y);
    WriteLn('The distance between player 1 and player 2 is '+inttostr(round(Dist)));
end.