From Stealth Client

Jump to: navigation, search
m (1 revision)
m
Line 6: Line 6:
</noinclude>
</noinclude>
== CalcDir ==
== CalcDir ==
-
<source lang="pascal">function CalcDir(Xfrom, Yfrom, Xto, Yto: Integer): Byte</source>
+
<source lang="pascal">function CalcDir(Xfrom, Yfrom, Xto, Yto:Integer):Byte</source>
 +
Returns the direction for the step from point''(Xfrom, Yfrom)'' to the point''(Xto, Yto)''. If'' Xfrom = Xto'' and'' Yfrom = Yto'' function will return'' 100''.
-
Возвращает направление для шага из точки ''(Xfrom, Yfrom)'' в точку ''(Xto, Yto)''. Если ''Xfrom=Xto'' и ''Yfrom=Yto'' функция вернет ''100''.
+
'''Example 1:'''
-
 
+
-
'''Пример 1:'''
+
<source lang="pascal">
<source lang="pascal">
-
Step(CalcDir(GetX(Self), GetY(Self), GetX(Self)+1, GetY(Self)), True);
+
Step(CalcDir(GetX(Self), GetY(Self), GetX(Self) +1, GetY(Self)), True);
</source>
</source>

Revision as of 21:39, 15 February 2012


CalcDir

function CalcDir(Xfrom, Yfrom, Xto, Yto:Integer):Byte

Returns the direction for the step from point(Xfrom, Yfrom) to the point(Xto, Yto). If Xfrom = Xto and Yfrom = Yto function will return 100.

Example 1:

Step(CalcDir(GetX(Self), GetY(Self), GetX(Self) +1, GetY(Self)), True);