1 | rot = direction; |
2 | deg = degtorad(rot); |
3 | x1 = x + (r * cos(deg)); |
4 | y1 = y - (r * sin(deg)); |
5 | x2 = x; |
6 | y2 = y; |
7 | scr_depth(); |
8 | draw_set_color(c_black); |
9 | if (shadowy < goaly) |
10 | shadowy += shadowspeed; |
11 | draw_rectangle(x1, shadowy + 8, x2, shadowy + 14, false); |
12 | draw_sprite_ext(sprite_index, image_index, x, y, 1, 1, direction, c_white, image_alpha); |
13 | draw_set_color(c_red); |
14 | draw_line(x1, y1, x2, y2); |
15 | if (y1 > (goaly - 2)) |
16 | { |
17 | if (collision_rectangle(x1, shadowy + 8, x2, shadowy + 14, obj_mainchara, 0, 1)) |
18 | event_user(2); |
19 | } |
20 | if (y1 >= (goaly + 9)) |
21 | event_user(3); |
22 | if (active == 0) |
23 | { |
24 | image_alpha -= 0.05; |
25 | if (image_alpha < 0.1) |
26 | active = 2; |
27 | } |
28 | if (active == 2) |
29 | instance_destroy(); |