1 |
if (move == true) |
2 |
{ |
3 |
if (axis_priority == "y") |
4 |
{ |
5 |
if (y != yy) |
6 |
{ |
7 |
if (abs(yy - y) < spd) |
8 |
spd = abs(yy - y) |
9 |
y += ((sign(yy - y)) * spd) |
10 |
} |
11 |
else if (xx != x) |
12 |
{ |
13 |
if (abs(xx - x) < spd) |
14 |
spd = abs(xx - x) |
15 |
x += ((sign(xx - x)) * spd) |
16 |
} |
17 |
} |
18 |
else if (axis_priority == "x") |
19 |
{ |
20 |
if (xx != x) |
21 |
{ |
22 |
if (abs(xx - x) < spd) |
23 |
spd = abs(xx - x) |
24 |
x += ((sign(xx - x)) * spd) |
25 |
} |
26 |
else if (yy != y) |
27 |
{ |
28 |
if (abs(yy - y) < spd) |
29 |
spd = abs(yy - y) |
30 |
y += ((sign(yy - y)) * spd) |
31 |
} |
32 |
} |
33 |
} |