1 |
l = 0; |
2 |
t = 0; |
3 |
w = sprite_width; |
4 |
h = sprite_height; |
5 |
ll = (global.idealborder[0] - x) + 1; |
6 |
tt = (global.idealborder[2] - y) + 1; |
7 |
ww = (x + w) - global.idealborder[1] - 1; |
8 |
hh = (y + h) - global.idealborder[3] - 1; |
9 |
if (ll > 0) |
10 |
l += ll; |
11 |
if (tt > 0) |
12 |
t += tt; |
13 |
if (ww > 0) |
14 |
w -= ww; |
15 |
if (hh > 0) |
16 |
h -= hh; |
17 |
w = round(w); |
18 |
h = round(h); |
19 |
l = round(l); |
20 |
t = round(t); |
21 |
if (w > 0 && h > 0) |
22 |
{ |
23 |
if (l < w && t < h) |
24 |
{ |
25 |
if (blue == 1) |
26 |
image_index = 1; |
27 |
draw_sprite_part(spr_bonetop, image_index, l, t, w - l, h - t, x + l, y + t); |
28 |
draw_sprite_part(spr_bonebottom, image_index, l, t, w - l, h - t, x + l, global.idealborder[3] - 10); |
29 |
} |
30 |
} |
31 |
if (x > (global.idealborder[0] - 5) && x < (global.idealborder[1] - 4)) |
32 |
{ |
33 |
drawn = 1; |
34 |
draw_set_color(c_white); |
35 |
if (blue == 1) |
36 |
draw_set_color(#14A9FF); |
37 |
ossafe_fill_rectangle(x + 3, y + 4, x + 9, global.idealborder[3] - 6); |
38 |
} |
39 |
if (abs(obj_heart.x - x) < 15 && global.invc < 1) |
40 |
{ |
41 |
if (collision_rectangle(x + 3, y + 2, x + 9, global.idealborder[3] - 2, obj_heart, 0, 1)) |
42 |
event_user(1); |
43 |
} |
44 |
if (x < (global.idealborder[0] - 10) && hspeed < 0) |
45 |
instance_destroy(); |
46 |
if (x > (global.idealborder[1] + 10) && hspeed > 0) |
47 |
instance_destroy(); |