Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_mouse_hat_Create_0

(view raw script w/o annotations or w/e)
1
image_xscale = 2;
2
image_yscale = 2;
3
image_speed = 0;
4
scr_depth
scr_depth

function
scr_depth(arg0 = id, arg1 = 0)
{ with (arg0) depth = 100000 - ((y * 10) + (sprite_height * 10) + (arg1 * 10)); }
(undefined, 20);
5
can_hat = true;
6
xoff = 0;
7
yoff = 0;
8
act = 0;
9
linked_char = -1;
10
type = 0;
11
scale = 1;
12
pickable = true;
13
spritestack = [];
14
indexstack = [];
15
16
stack_hat = function(arg0, arg1)
17
{
18
    array_push(spritestack, arg0);
19
    array_push(indexstack, arg1);
20
};
21
22
unstack_hat = function()
23
{
24
    if (array_length(spritestack) > 0)
25
    {
26
        var hat = instance_create(x, y, obj_mouse_hat);
27
        var idx = array_length(spritestack) - 1;
28
        hat.sprite_index = spritestack[idx];
29
        hat.image_index = indexstack[idx];
30
        array_delete(spritestack, idx, 1);
31
        array_delete(indexstack, idx, 1);
32
        return hat;
33
    }
34
    else
35
    {
36
        return self;
37
    }
38
};