1 |
if (con == 0) |
2 |
{ |
3 |
image_alpha += 0.25; |
4 |
y += 4; |
5 |
if (image_alpha >= 1.5) |
6 |
{ |
7 |
image_alpha = 1; |
8 |
con = 1; |
9 |
y = ystart + 40; |
10 |
} |
11 |
} |
12 |
if (con == 1 && !d_ex()) |
13 |
{ |
14 |
timer++; |
15 |
if (timer >= 2) |
16 |
{ |
17 |
if (direction == 90 || direction == 270) |
18 |
{ |
19 |
if (direction == 90) |
20 |
{ |
21 |
if (place_meeting(x, y - 40, obj_solidblock)) |
22 |
{ |
23 |
direction = 0; |
24 |
x += 40; |
25 |
} |
26 |
else |
27 |
{ |
28 |
direction = 90; |
29 |
y -= 40; |
30 |
} |
31 |
} |
32 |
if (direction == 270) |
33 |
{ |
34 |
if (place_meeting(x, y + 40, obj_solidblock)) |
35 |
{ |
36 |
direction = 0; |
37 |
x += 40; |
38 |
} |
39 |
else |
40 |
{ |
41 |
direction = 270; |
42 |
y += 40; |
43 |
} |
44 |
} |
45 |
} |
46 |
else if (place_meeting(x, y - 40, obj_solidblock) && place_meeting(x, y + 40, obj_solidblock)) |
47 |
{ |
48 |
direction = 0; |
49 |
x += 40; |
50 |
} |
51 |
else if (!place_meeting(x, y - 40, obj_solidblock)) |
52 |
{ |
53 |
direction = 90; |
54 |
y -= 40; |
55 |
} |
56 |
else if (!place_meeting(x, y + 40, obj_solidblock)) |
57 |
{ |
58 |
direction = 270; |
59 |
y += 40; |
60 |
} |
61 |
movex = 0; |
62 |
movey = 0; |
63 |
timer = 0; |
64 |
} |
65 |
} |
66 |
if (con == 2) |
67 |
{ |
68 |
depth += 1; |
69 |
y -= 4; |
70 |
image_alpha -= 0.25; |
71 |
deathtimer++; |
72 |
if (deathtimer >= 3) |
73 |
instance_destroy(); |
74 |
} |