1 | y += (move_speed * dir) |
2 | if (fade_state == 0) |
3 | { |
4 | image_alpha += fade_speed |
5 | if (image_alpha >= 1) |
6 | { |
7 | image_alpha = 1 |
8 | fade_state = 1 |
9 | center_dist = box.y - y |
10 | } |
11 | } |
12 | if (fade_state == 2) |
13 | { |
14 | image_alpha -= fade_speed |
15 | if (image_alpha <= 0) |
16 | instance_destroy() |
17 | } |
18 | if (fade_state == 1) |
19 | { |
20 | var dist_temp = box.y - y |
21 | if (abs(dist_temp) >= abs(center_dist) && (sign(dist_temp) != sign(center_dist) || sign(center_dist) == 0)) |
22 | fade_state = 2 |
23 | } |