1 | if (!instance_exists(obj_heart_battle_fighting_parent)) |
2 | { |
3 | instance_destroy() |
4 | return; |
5 | } |
6 | if (image_alpha < 1 && can_move == false) |
7 | { |
8 | image_alpha += 0.1 |
9 | if (image_alpha > 1) |
10 | image_alpha = 1 |
11 | if (image_alpha == 1) |
12 | can_move = true |
13 | } |
14 | if (can_move == true) |
15 | { |
16 | if (angle_movement == 1) |
17 | { |
18 | if (angle > angle_min) |
19 | angle -= angle_sway |
20 | else |
21 | { |
22 | angle = angle_min |
23 | angle_movement = -1 |
24 | } |
25 | } |
26 | if (angle_movement == -1) |
27 | { |
28 | if (angle < angle_max) |
29 | angle += angle_sway |
30 | else |
31 | { |
32 | angle = angle_max |
33 | angle_movement = 1 |
34 | } |
35 | } |
36 | x += lengthdir_x(fly_speed, angle) |
37 | y += lengthdir_y(fly_speed, angle) |
38 | image_angle = angle |
39 | } |
40 | if (fade_out == true) |
41 | { |
42 | image_alpha -= 0.1 |
43 | if (image_alpha < 0) |
44 | image_alpha = 0 |
45 | if (image_alpha == 0) |
46 | instance_destroy() |
47 | } |