Deltarune (Chapter 2) script viewer

← back to main script listing

gml_Object_obj_holemouse_Draw_0

(view raw script w/o annotations or w/e)
1
if (room == room_dw_city_mice2)
2
{
3
    scr_depth
scr_depth

function scr_depth() { depth = 100000 - ((y * 10) + (sprite_height * 10)); }
();
4
    if (place_meeting(x, y, obj_forcefield))
5
    {
6
        var inst = instance_place(x, y, obj_forcefield);
7
        depth = inst.depth + 10;
8
    }
9
}
10
else
11
{
12
    depth = 800000;
13
}
14
if (direction == 0 && currentdir > 260)
15
    currentdir = -90;
16
if (direction == 270 && currentdir < 45)
17
    currentdir = 360;
18
prevdir = currentdir;
19
if (abs(currentdir - direction) <= 90)
20
{
21
    if ((currentdir - direction) > 0)
22
        currentdir -= 45;
23
    if ((currentdir - direction) < 0)
24
        currentdir += 45;
25
}
26
else
27
{
28
    if ((currentdir - direction) > 0)
29
        currentdir = direction + 45;
30
    if ((currentdir - direction) < 0)
31
        currentdir = direction - 45;
32
}
33
if (con == 0)
34
    draw_sprite_ext(spr_holemouse_emerge, 0, x + 20, y + 20, 2, 2, 0, c_white, image_alpha);
35
if (con == 1)
36
{
37
    draw_set_color(c_white);
38
    draw_sprite_ext(spr_holemouse_tail, timer / 2, x + 20, y + 20, 2, 2, prevdir, c_white, image_alpha);
39
    draw_sprite_ext(spr_holemouse, 0, x + 20, y + 20, 2, 2, currentdir, c_white, image_alpha);
40
}
41
if (con == 2)
42
    draw_sprite_ext(spr_holemouse_exit, 0, x + 20, y + 20, 2, 2, 0, c_white, image_alpha);
43
if (con >= 5)
44
{
45
    draw_set_color(c_black);
46
    draw_ellipse((x + 20) - 10, y + 20 + 15, x + 20 + 10, y + 20 + 20, false);
47
    if (customSprite == spr_holemouse)
48
    {
49
        draw_sprite_ext(spr_holemouse_tail, timer / 2, x + 20, y + 20 + fakeY, 2, 2, prevdir, c_white, image_alpha);
50
        draw_sprite_ext(spr_holemouse, 0, x + 20, y + 20 + fakeY, 2, 2, currentdir, c_white, image_alpha);
51
    }
52
    else
53
    {
54
        draw_sprite_ext(customSprite, 0, x + 20, y + 20 + fakeY, 2, 2, 0, c_white, image_alpha);
55
    }
56
}