1 |
friction = 0.2; |
2 |
image_alpha = 0.8; |
3 |
if (instance_exists(obj_mainchara) && getdepth) |
4 |
depth = obj_mainchara.depth + 100; |
5 |
remx = x; |
6 |
remy = y; |
7 |
x += random_range(1, -1); |
8 |
y += random_range(1, -1); |
9 |
hspeed += random_range(-0.5, 0.5); |
10 |
vspeed += random_range(-0.5, 0.5); |
11 |
image_angle += random_range(10, -10); |
12 |
if (place_meeting(x, y, obj_solidblock) || (place_meeting(x, y, obj_bug_treasure_chest) && getdepth == true)) |
13 |
{ |
14 |
x = remx; |
15 |
y = remy; |
16 |
} |
17 |
if (y > room_height) |
18 |
y = remy; |
19 |
timer++; |
20 |
if (timer >= lifecycle) |
21 |
image_alpha *= 0.9; |
22 |
if (image_alpha < 0.05) |
23 |
instance_destroy(); |
24 |
if (y <= (starty - 20) || timer > 10) |
25 |
getdepth = true; |