1 |
if (instance_exists(obj_heart_battle_fighting_parent)) |
2 |
{ |
3 |
if (image_alpha < 1 && can_move == false) |
4 |
{ |
5 |
image_alpha += 0.1; |
6 |
if (image_alpha > 1) |
7 |
image_alpha = 1; |
8 |
if (image_alpha == 1) |
9 |
can_move = true; |
10 |
} |
11 |
if (can_move == true) |
12 |
{ |
13 |
x += hsp; |
14 |
vsp += grav; |
15 |
if (vsp > terminal_velocity) |
16 |
vsp = terminal_velocity; |
17 |
y += vsp; |
18 |
image_angle += image_angle_increase; |
19 |
if (bbox_bottom >= (obj_dialogue_box_battle_transformation_any.bbox_bottom - 4) && can_bounce == true) |
20 |
{ |
21 |
while (bbox_bottom > (obj_dialogue_box_battle_transformation_any.bbox_bottom - 4)) |
22 |
y -= 1; |
23 |
image_index = 1; |
24 |
hsp = hsp_bounce; |
25 |
vsp = -jump_speed - grav; |
26 |
image_angle_increase = -image_angle_increase; |
27 |
can_bounce = false; |
28 |
var random_pitch = irandom_range(-1, 1); |
29 |
audio_play_sound(snd_washpan_bonk, 20, 0); |
30 |
audio_sound_pitch(snd_washpan_bonk, 1 + (random_pitch * 0.3)); |
31 |
} |
32 |
if (place_meeting(x, y, obj_dialogue_box_battle_transformation_any)) |
33 |
can_vanish = true; |
34 |
if (!place_meeting(x, y, obj_dialogue_box_battle_transformation_any) && can_vanish == true) |
35 |
{ |
36 |
if (image_alpha > 0) |
37 |
{ |
38 |
image_alpha -= 0.1; |
39 |
if (image_alpha < 0) |
40 |
image_alpha = 0; |
41 |
if (image_alpha == 0) |
42 |
instance_destroy(); |
43 |
} |
44 |
} |
45 |
} |
46 |
} |