1 |
if (instance_exists(obj_mainchara)) |
2 |
distance = distance_to_object(obj_mainchara); |
3 |
else |
4 |
distance = 999; |
5 |
if (holecon == 0) |
6 |
{ |
7 |
if (distance <= maxdist) |
8 |
{ |
9 |
holecon = 1; |
10 |
image_index = 0; |
11 |
sprite_index = spr_cloverhole; |
12 |
} |
13 |
} |
14 |
if (holecon == 1) |
15 |
{ |
16 |
if (distance <= (maxdist + 20)) |
17 |
{ |
18 |
image_index += 0.5; |
19 |
if (image_index >= 10) |
20 |
{ |
21 |
image_index = 0; |
22 |
sprite_index = sprite_type[type]; |
23 |
holecon = 2; |
24 |
} |
25 |
} |
26 |
else |
27 |
{ |
28 |
image_index -= 0.5; |
29 |
if (image_index <= 0) |
30 |
{ |
31 |
image_index = 0; |
32 |
holecon = 0; |
33 |
} |
34 |
} |
35 |
} |
36 |
if (holecon == 2) |
37 |
{ |
38 |
image_index += 0.334; |
39 |
if (distance > (maxdist + 10)) |
40 |
{ |
41 |
sprite_index = spr_cloverhole; |
42 |
image_index = 10; |
43 |
holecon = 1; |
44 |
} |
45 |
} |