Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_mike_minigame_controller_Draw_0

(view raw script w/o annotations or w/e)
1
with (obj_gravity_hoop)
2
    draw_sprite_ext(sprite_index, 1, x + random_x, y + random_y, image_xscale, image_yscale, 0, image_blend, 1);
3
if (
scr_debug
scr_debug

function
scr_debug()
{ if (global.debug == 1) return 1; }
())
4
{
5
    draw_set_colour(c_white);
6
    draw_set_font(fnt_main);
7
}
8
var _hs = obj_mike_minigame_tv.hiscore[obj_mike_minigame_tv.minigame];
9
new_hiscore -= 1;
10
if (new_hiscore > 0)
11
{
12
    draw_set_halign(fa_center);
13
    draw_set_font(fnt_mainbig);
14
    draw_set_colour(c_yellow);
15
    if (vis)
16
        draw_text(320, 80, stringsetloc(
* NEW HISCORE! *\n
"* NEW HISCORE! *\n", "obj_mike_minigame_controller_slash_Draw_0_gml_28_0"
) + string(_hs));
17
    draw_set_halign(fa_left);
18
}
19
if (phase == 0)
20
{
21
    music_y = lerp(music_y, 0, 0.5);
22
    draw_set_colour(c_white);
23
    draw_set_font(fnt_mainbig);
24
    draw_set_halign(fa_center);
25
    draw_text(240, 24 + music_y, stringsetloc(
MUSIC:
"MUSIC: ", "obj_mike_minigame_controller_slash_Draw_0_gml_54_0"
));
26
    if (point_distance(obj_mike_controller.mx, obj_mike_controller.my, 360, 64 + music_y) < 20)
27
    {
28
        draw_set_colour(c_yellow);
29
        if (scr_mouse_leftclick())
30
        {
31
            if (!music_on)
32
            {
33
                snd_play(snd_item);
34
                global.batmusic[1] = mus_loop_ext(global.batmusic[0], 1, 1);
35
            }
36
            with (obj_hand_collision)
37
                instance_destroy();
38
            music_on = true;
39
        }
40
    }
41
    else if (music_on)
42
    {
43
        draw_set_colour(c_white);
44
    }
45
    else
46
    {
47
        draw_set_colour(c_gray);
48
    }
49
    ossafe_fill_rectangle(332, 28 + music_y, 384, 54 + music_y, 1);
50
    draw_text(360, 24 + music_y, stringsetloc(
ON
"ON", "obj_mike_minigame_controller_slash_Draw_0_gml_70_0"
));
51
    if (point_distance(obj_mike_controller.mx, obj_mike_controller.my, 440, 64 + music_y) < 30)
52
    {
53
        draw_set_colour(c_yellow);
54
        if (scr_mouse_leftclick())
55
        {
56
            if (music_on)
57
            {
58
                snd_play(snd_item);
59
                snd_stop(global.batmusic[1]);
60
            }
61
            with (obj_hand_collision)
62
                instance_destroy();
63
            music_on = false;
64
        }
65
    }
66
    else if (!music_on)
67
    {
68
        draw_set_colour(c_white);
69
    }
70
    else
71
    {
72
        draw_set_colour(c_gray);
73
    }
74
    ossafe_fill_rectangle(412, 28 + music_y, 464, 54 + music_y, 1);
75
    draw_text(440, 24 + music_y, stringsetloc(
OFF
"OFF", "obj_mike_minigame_controller_slash_Draw_0_gml_87_0"
));
76
}
77
else
78
{
79
    music_y = -64;
80
}
81
if (action == 3 && phase == 0)
82
{
83
    var __y = 288;
84
    draw_set_colour(c_white);
85
    draw_set_font(
scr_84_get_font
scr_84_get_font

function
scr_84_get_font(arg0)
{ if (!variable_global_exists("chemg_last_get_font")) global.chemg_last_get_font = ""; if (arg0 != global.chemg_last_get_font) global.chemg_last_get_font = arg0; return ds_map_find_value(global.font_map, arg0); }
("mainbig"));
86
    draw_text(240, (24 - music_y) + __y, stringsetloc(
INVERT VOL:
"INVERT VOL: ", "obj_mike_minigame_controller_slash_Draw_0_gml_109_0"
));
87
    draw_set_font(fnt_mainbig);
88
    if (point_distance(obj_mike_controller.mx, obj_mike_controller.my, 360, 32 + __y) < 20)
89
    {
90
        draw_set_colour(c_yellow);
91
        if (scr_mouse_leftclick())
92
        {
93
            if (!inv_mic)
94
                snd_play(snd_item);
95
            with (obj_hand_collision)
96
                instance_destroy();
97
            inv_mic = true;
98
        }
99
    }
100
    else if (inv_mic)
101
    {
102
        draw_set_colour(c_white);
103
    }
104
    else
105
    {
106
        draw_set_colour(c_gray);
107
    }
108
    ossafe_fill_rectangle(332, (28 - music_y) + __y, 384, 54 + music_y + __y, 1);
109
    draw_text(360, (24 - music_y) + __y, stringsetloc(
ON
"ON", "obj_mike_minigame_controller_slash_Draw_0_gml_127_0"
));
110
    if (point_distance(obj_mike_controller.mx, obj_mike_controller.my, 440, 32 + __y) < 30)
111
    {
112
        draw_set_colour(c_yellow);
113
        if (scr_mouse_leftclick())
114
        {
115
            if (inv_mic)
116
                snd_play(snd_item);
117
            with (obj_hand_collision)
118
                instance_destroy();
119
            inv_mic = false;
120
        }
121
    }
122
    else if (!inv_mic)
123
    {
124
        draw_set_colour(c_white);
125
    }
126
    else
127
    {
128
        draw_set_colour(c_gray);
129
    }
130
    ossafe_fill_rectangle(412, (28 - music_y) + __y, 464, 54 + music_y + __y, 1);
131
    draw_text(440, (24 - music_y) + __y, stringsetloc(
OFF
"OFF", "obj_mike_minigame_controller_slash_Draw_0_gml_143_0"
));
132
    draw_set_halign(fa_left);
133
}
134
if (action == 2 && wave == 2)
135
{
136
    retry_y = lerp(retry_y, 0, 0.5);
137
    draw_set_colour(c_white);
138
    draw_set_font(fnt_mainbig);
139
    draw_set_halign(fa_center);
140
    if (point_distance(obj_mike_controller.mx, obj_mike_controller.my, 160, 64 + retry_y) < 20)
141
    {
142
        draw_set_colour(c_yellow);
143
        if (scr_mouse_leftclick())
144
        {
145
            snd_play(snd_item);
146
            myscore = 0;
147
            with (obj_hand_collision)
148
                instance_destroy();
149
            with (obj_gravity_ball)
150
            {
151
                
scr_sparkle
scr_sparkle

function
scr_sparkle(arg0)
{ var num = arg0; dir = irandom(360); for (i = 0; i < num; i++) { var _ob = instance_create_depth(x + lengthdir_x(16, dir + ((i / num) * 360)), y + lengthdir_y(16, dir + ((i / num) * 360)), depth - 1, obj_heart_sparkle); _ob.speed = 4; _ob.direction = (i / num) * 360; } } function scr_sparkle_pos(arg0, arg1, arg2) { var num = arg0; dir = irandom(360); for (i = 0; i < num; i++) { var _ob = instance_create_depth(arg1 + lengthdir_x(16, dir + ((i / num) * 360)), arg2 + lengthdir_y(16, dir + ((i / num) * 360)), depth - 1, obj_heart_sparkle); _ob.speed = 4; _ob.direction = (i / num) * 360; } } function scr_sparkle_colour(arg0, arg1) { var num = arg0; dir = 0; for (i = 0; i < num; i++) { var _ob = instance_create_depth(x + lengthdir_x(16, dir + ((i / num) * 360)), y + lengthdir_y(16, dir + ((i / num) * 360)), depth - 5, obj_heart_sparkle); _ob.speed = 4; _ob.direction = (i / num) * 360; _ob.image_blend = arg1; } } function scr_sparkle_random(arg0) { var num = arg0; dir = irandom(360); for (i = 0; i < num; i++) { with (instance_create_depth(x + lengthdir_x(16, (i / num) * 360), y + lengthdir_y(16, (i / num) * 360), depth - 1, obj_heart_sparkle)) motion_set(other.dir, irandom_range(4, 6)); dir += irandom(30); } }
(8);
152
                instance_destroy();
153
            }
154
            wave = 0;
155
        }
156
    }
157
    else
158
    {
159
        draw_set_colour(c_white);
160
    }
161
    ossafe_fill_rectangle(120, 28 + retry_y, 196, 54 + retry_y, 1);
162
    draw_text(160, 24 + retry_y, stringsetloc(
RETRY
"RETRY", "obj_mike_minigame_controller_slash_Draw_0_gml_120_0"
));
163
    if (point_distance(obj_mike_controller.mx, obj_mike_controller.my, 260, 64 + retry_y) < 30)
164
    {
165
        draw_set_colour(c_yellow);
166
        if (scr_mouse_leftclick())
167
        {
168
            game_over = true;
169
            wave = 0;
170
            with (obj_hand_collision)
171
                instance_destroy();
172
            snd_play(snd_item);
173
        }
174
    }
175
    else
176
    {
177
        draw_set_colour(c_white);
178
    }
179
    ossafe_fill_rectangle(222, 28 + retry_y, 298, 54 + retry_y, 1);
180
    draw_text(260, 24 + retry_y, stringsetloc(
QUIT
"QUIT", "obj_mike_minigame_controller_slash_Draw_0_gml_137_0"
));
181
    draw_set_halign(fa_left);
182
}
183
else
184
{
185
    retry_y = -64;
186
}