1 |
var note_hit = false; |
2 |
var instance; |
3 |
if (instance_exists(obj_sme_yellow_rhythm_note)) |
4 |
{ |
5 |
var y_restore = y; |
6 |
i = -hit_extend_neg; |
7 |
while (i <= hit_extend_pos) |
8 |
{ |
9 |
y = y_restore - i; |
10 |
instance = instance_place(x, y, obj_sme_yellow_rhythm_note); |
11 |
if (instance != -4) |
12 |
{ |
13 |
note_hit = true; |
14 |
break; |
15 |
} |
16 |
if (grace_period_current > 0) |
17 |
{ |
18 |
instance = instance_place(pos_x_previous_selection, y, obj_sme_yellow_rhythm_note); |
19 |
if (instance != -4) |
20 |
{ |
21 |
note_hit = true; |
22 |
break; |
23 |
} |
24 |
} |
25 |
i++; |
26 |
} |
27 |
y = y_restore; |
28 |
} |
29 |
if (note_hit == true) |
30 |
{ |
31 |
with (instance) |
32 |
{ |
33 |
if (note_sound != 0) |
34 |
audio_play_sound(note_sound, 20, false); |
35 |
global.id_store = id; |
36 |
instance_create(x, y, obj_sme_yellow_rhythm_note_end); |
37 |
instance_destroy(); |
38 |
} |
39 |
instance_create(x, bbox_top - 1, obj_sme_yellow_rhythm_hit); |
40 |
} |
41 |
else |
42 |
{ |
43 |
instance_create(damage_pos_x, damage_pos_y, obj_sme_yellow_rhythm_damage); |
44 |
} |