ScriptCore3.Distance

From Soldat Community Wiki
Revision as of 17:47, 1 May 2018 by Morko (talk | contribs) (Examples)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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.