Undertale script viewer

← back to main script listing

gml_Object_obj_cookhud_Draw_0

(view raw script w/o annotations or w/e)
1
y = view_yview[0] + 40;
2
if (con == 0 && x >= view_xview[0])
3
{
4
    x = view_xview[0];
5
    hspeed = 0;
6
    friction = 0;
7
    con = 1;
8
}
9
if (instance_exists(obj_jetpackchara))
10
{
11
    time = obj_jetpackchara.timertime;
12
    dist = obj_jetpackchara.dist;
13
}
14
else
15
{
16
    dist += 1;
17
    time -= 1;
18
}
19
draw_sprite(spr_goalhud, 0, x, y);
20
ballx = ((maxdist - dist) / maxdist) * 27;
21
draw_sprite(spr_goalhud_ball, 0, x + 62 + ballx, y + 5);
22
pizzax = ((inittime - time) / inittime) * 9;
23
draw_sprite(spr_timehud, 0, x, y + 30);
24
draw_sprite(spr_pizzaclock, pizzax, x + 62, y + 33);
25
thisnum = ceil(time / 30);
26
if (thisnum >= 0)
27
{
28
    place = 0;
29
    numadd = 10;
30
    if (thisnum >= numadd)
31
    {
32
        while (thisnum >= numadd)
33
        {
34
            place += 1;
35
            numadd *= 10;
36
        }
37
    }
38
}
39
else
40
{
41
    thisnum = 0;
42
    place = 0;
43
}
44
thisnum2 = thisnum;
45
for (i = place; i >= 0; i -= 1)
46
{
47
    numnum[i] = floor(thisnum2 / power(10, i));
48
    thisnum2 -= (numnum[i] * power(10, i));
49
}
50
for (i = place; i >= 0; i -= 1)
51
{
52
    draw_set_color(c_red);
53
    draw_sprite(spr_digitalnumber, numnum[i], (x + 92) - (i * 9), y + 34);
54
}
55
if (finished == 1)
56
{
57
    hspeed -= 0.5;
58
    if (x < -110)
59
        instance_destroy();
60
}