| 1 |
spear_spawn_delay -= 1; |
| 2 |
if (spear_spawn_delay <= 0) |
| 3 |
{ |
| 4 |
spear_spawn_delay = 30; |
| 5 |
var final_spear = false; |
| 6 |
var spear_x, spear_y; |
| 7 |
if (spear_spawn_count > 0 && obj_pl.x < 1580) |
| 8 |
{ |
| 9 |
spear_x = irandom_range(obj_pl.x + 20, obj_pl.x + 100); |
| 10 |
spear_y = obj_pl.y - 50; |
| 11 |
} |
| 12 |
else |
| 13 |
{ |
| 14 |
spear_x = obj_pl.x + 160; |
| 15 |
spear_y = obj_pl.y + 15; |
| 16 |
final_spear = true; |
| 17 |
scr_cutscene_start(); |
| 18 |
} |
| 19 |
var spear = instance_create_depth(spear_x, spear_y, obj_pl.depth - 1, obj_flowey_world_spear); |
| 20 |
if (final_spear) |
| 21 |
{ |
| 22 |
spear.speed_max = 18; |
| 23 |
spear.image_alpha = 1; |
| 24 |
spear.scene = 1; |
| 25 |
audio_play_sound(snd_undertale_swoosh, 1, 0); |
| 26 |
} |
| 27 |
spear_spawn_count -= 1; |
| 28 |
} |