1 |
if live_call() |
2 |
return global.live_result; |
3 |
script_execute(gml_Script_scr_controls_battle_heart_red) |
4 |
x_previous = x |
5 |
y_previous = y |
6 |
move_x = key_left + key_right |
7 |
move_y = key_down + key_up |
8 |
hsp = move_x * walk_speed |
9 |
vsp = move_y * walk_speed |
10 |
if key_revert |
11 |
{ |
12 |
hsp = round(hsp / 2) |
13 |
vsp = round(vsp / 2) |
14 |
} |
15 |
hsp += hsp_factor |
16 |
vsp += vsp_factor |
17 |
if (sign(hsp) == -1 && (bbox_left + hsp) <= 0) |
18 |
{ |
19 |
while ((bbox_left + sign(hsp)) > 0) |
20 |
x += sign(hsp) |
21 |
hsp = 0 |
22 |
} |
23 |
else if (sign(hsp) == 1 && (bbox_right + hsp) >= room_width) |
24 |
{ |
25 |
while ((bbox_right + sign(hsp)) < room_width) |
26 |
x += sign(hsp) |
27 |
hsp = 0 |
28 |
} |
29 |
x += hsp |
30 |
if (sign(vsp) == -1 && (bbox_top + vsp) <= 260) |
31 |
{ |
32 |
while ((bbox_top + sign(vsp)) > 300) |
33 |
y += sign(vsp) |
34 |
vsp = 0 |
35 |
} |
36 |
else if (sign(vsp) == 1 && (bbox_bottom + vsp) >= room_height) |
37 |
{ |
38 |
while ((bbox_bottom + sign(vsp)) < room_height) |
39 |
y += sign(vsp) |
40 |
vsp = 0 |
41 |
} |
42 |
y += vsp |
43 |
obj_heart_red_hitbox.x = x |
44 |
obj_heart_red_hitbox.y = y |
45 |
if instance_exists(obj_heart_battle_effect_glow) |
46 |
{ |
47 |
obj_heart_battle_effect_glow.x = x |
48 |
obj_heart_battle_effect_glow.y = y |
49 |
} |
50 |
if (moveable == true && global.current_sp_self > 0) |
51 |
{ |
52 |
var can_trail = false |
53 |
trail_cc_current += 1 |
54 |
if (trail_cc_current >= trail_cc_max) |
55 |
{ |
56 |
can_trail = true |
57 |
trail_cc_current = 0 |
58 |
} |
59 |
if (can_trail == true) |
60 |
{ |
61 |
ds_list_add(x_list, x) |
62 |
ds_list_add(y_list, y) |
63 |
while (ds_list_size(x_list) > max_points_trail) |
64 |
{ |
65 |
ds_list_delete(x_list, 0) |
66 |
ds_list_delete(y_list, 0) |
67 |
} |
68 |
} |
69 |
} |
70 |
if (keyboard_multicheck_pressed(0) && sprite_index == spr_heart_yellow_up && can_shoot == true) |
71 |
{ |
72 |
sprite_index = spr_heart_yellow_shoot |
73 |
image_index = 0 |
74 |
instance_create_depth((x + 0.5), (y - 6), (depth - 1), obj_heart_yellow_shot) |
75 |
can_shoot = false |
76 |
alarm[1] = shoot_delay |
77 |
} |
78 |
event_user(15) |