Undertale script viewer

← back to main script listing

gml_Object_obj_controltest_Draw_0

(view raw script w/o annotations or w/e)
1
z_index = 0;
2
x_index = 0;
3
c_index = 0;
4
buffer -= 1;
5
if (buffer < 0)
6
{
7
    if (control_check(0))
8
        z_index = 2;
9
    else if (z_index == 1)
10
        z_index = 3;
11
    if (control_check_pressed(0))
12
    {
13
        if (fun == 1)
14
        {
15
            image_index += 1;
16
            caster_play(s_snare, 1, 1);
17
        }
18
        z_index = 1;
19
    }
20
    if (control_check(1))
21
        x_index = 2;
22
    else if (x_index == 1)
23
        x_index = 3;
24
    if (control_check_pressed(1))
25
    {
26
        if (fun == 1)
27
        {
28
            image_index += 1;
29
            caster_play(s_kick, 1, 1);
30
        }
31
        x_index = 1;
32
    }
33
    if (control_check(2))
34
        c_index = 2;
35
    else if (c_index == 1)
36
        c_index = 3;
37
    if (control_check_pressed(2))
38
    {
39
        if (fun == 1)
40
        {
41
            image_index += 1;
42
            caster_play(s_cymbal, 1, 1);
43
        }
44
        c_index = 1;
45
    }
46
    if (keyboard_check_pressed(ord("R")))
47
    {
48
        if (fun == 1)
49
        {
50
            image_index += 1;
51
            caster_play(s_cuica, 1, 1);
52
        }
53
    }
54
    if (keyboard_check_pressed(ord("E")))
55
    {
56
        if (fun == 1)
57
        {
58
            image_index += 1;
59
            caster_play(s_cuica2, 1, 1);
60
        }
61
    }
62
}
63
draw_sprite_ext(spr_test_zbutton, z_index, 80, 30, 2, 2, 0, c_white, 1);
64
draw_sprite_ext(spr_test_xbutton, x_index, 140, 30, 2, 2, 0, c_white, 1);
65
draw_sprite_ext(spr_test_cbutton, c_index, 200, 30, 2, 2, 0, c_white, 1);
66
if (fun == 1)
67
{
68
    draw_sprite(sprite_index, image_index, x, y);
69
}
70
else
71
{
72
    draw_set_color(c_green);
73
    draw_circle(x + 16, y + 16, 16, 1);
74
    draw_circle(x + 16, y + 16, 14, 1);
75
    draw_circle(x + 16, y + 16, 12, 1);
76
    draw_set_color(c_black);
77
    draw_circle(x + 16, y + 16, 17, 1);
78
    draw_circle(x + 16, y + 16, 15, 1);
79
    draw_circle(x + 16, y + 16, 13, 1);
80
}
81
draw_set_color(c_white);
82
for (i = 0; i < 6; i += 1)
83
    draw_rectangle(borderl - i, borderu - i, borderr + i, 300, true);
84
if (obj_time.left)
85
    x -= 3;
86
if (obj_time.right)
87
    x += 3;
88
if (obj_time.down)
89
    y += 3;
90
if (obj_time.up)
91
    y -= 3;
92
if (x <= borderl)
93
    x = borderl;
94
if (x >= (borderr - 32))
95
    x = borderr - 32;
96
if (y <= borderu)
97
    y = borderu;
98
if (y >= 240)
99
{
100
    global.to_joyconfig = 1;
101
    room_goto(room_settings);
102
}