Undertale script viewer

← back to main script listing

gml_Object_obj_mettanchor_Step_2

(view raw script w/o annotations or w/e)
1
if (global.flag[20 animation_index] <= 9 && global.flag[20 animation_index] > 0)
2
    j = global.flag[20 animation_index];
3
sprite_index = mysprite[j - 1];
4
if (instance_exists(obj_shaker) == 0)
5
{
6
    if (on == 1)
7
    {
8
        view_xview[0] = round((obj_mainchara.x - (view_wview[0] / 2)) + 10);
9
        view_yview[0] = round((obj_mainchara.y - (view_hview[0] / 2)) + 10);
10
        if (view_yview[0] <= 0)
11
            view_yview[0] = 0;
12
    }
13
}
14
if (on == 1)
15
{
16
    x = view_xview[0] + stayx;
17
    y = view_yview[0] + stayy;
18
}
19
if (on == 2)
20
{
21
    adjust = 0;
22
    if (x > ((view_xview[0] + view_wview[0]) - 50))
23
    {
24
        x -= 4;
25
        adjust = 1;
26
    }
27
    if (y > ((view_yview[0] + view_hview[0]) - 80))
28
    {
29
        y -= 4;
30
        adjust = 1;
31
    }
32
    if (adjust == 0)
33
    {
34
        siner += 1;
35
        x += (cos(siner / 2) * 0.5);
36
        y += sin(siner / 6);
37
    }
38
}
39
if (view_yview[0] <= 0)
40
    view_yview[0] = 0;