Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_steamworks_22_axis_throwing_Step_0

(view raw script w/o annotations or w/e)
1
if (!instance_exists(obj_pl))
2
    exit;
3
if (state == "idle")
4
{
5
    if (sprite_index != spr_axis_down)
6
    {
7
        sprite_index = spr_axis_down;
8
        image_speed = 0.2;
9
        image_index = 0;
10
    }
11
}
12
if (state == "throw")
13
{
14
    if (global.cutscene == true)
15
    {
16
        state = "idle";
17
        image_speed = 0;
18
        exit;
19
    }
20
    if (sprite_index != spr_steamworks_axis_throw)
21
    {
22
        sprite_index = spr_steamworks_axis_throw;
23
        image_speed = 1;
24
        image_index = 0;
25
    }
26
    else if (image_index >= 6 && ball_spawn_noloop == false)
27
    {
28
        ball_spawn_noloop = true;
29
        instance_create_depth(x, y - 16, -240, obj_steamworks_22_energy_ball);
30
    }
31
    else if (image_index >= (image_number - 1))
32
    {
33
        state = "idle";
34
        image_speed = 0;
35
        ball_spawn_noloop = false;
36
        alarm[0] = throw_interval;
gml_Object_obj_steamworks_22_axis_throwing_Alarm_0.gml

if (obj_pl.x > 1860) { state = "idle"; image_speed = 0; ball_spawn_noloop = false; alarm[0] = throw_interval; } else { state = "throw"; }
37
    }
38
}
39
if (abs(x - obj_pl.x) > 15)
40
    x = lerp(x, clamp(obj_pl.x, 0, 1860), 0.1);
41
player_x_last = obj_pl.x;
42
if (x < 470 && instance_exists(obj_player_npc))
43
    instance_destroy();