Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_flowey_world_spear_spawner_Step_0

(view raw script w/o annotations or w/e)
1
spear_spawn_delay -= 1
2
if (spear_spawn_delay <= 0)
3
{
4
    spear_spawn_delay = 30
5
    var final_spear = false
6
    if (spear_spawn_count > 0 && obj_pl.x < 1580)
7
    {
8
        var spear_x = irandom_range((obj_pl.x + 20), (obj_pl.x + 100))
9
        var spear_y = obj_pl.y - 50
10
    }
11
    else
12
    {
13
        spear_x = obj_pl.x + 160
14
        spear_y = obj_pl.y + 15
15
        final_spear = true
16
        scr_cutscene_start
scr_cutscene_start

function scr_cutscene_start() //gml_Script_scr_cutscene_start { global.cutscene = true obj_pl.state = gml_Script_scr_frozen_state obj_pl.image_index = 0 obj_pl.image_speed = 0 }
()
17
    }
18
    var spear = instance_create_depth(spear_x, spear_y, (obj_pl.depth - 1), obj_flowey_world_spear)
19
    if final_spear
20
    {
21
        spear.speed_max = 18
22
        spear.image_alpha = 1
23
        spear.scene = 1
24
        audio_play_sound(snd_undertale_swoosh, 1, 0)
25
    }
26
    spear_spawn_count -= 1
27
}