Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj____Draw_0

(view raw script w/o annotations or w/e)
1
if (hurttimer > 0)
2
{
3
    hurttimer--;
4
    if ((hurttimer % 2) == 0)
5
    {
6
        if (sprite_index == spr___hurt)
7
            sprite_index = spr___;
8
        else
9
            sprite_index = spr___hurt;
10
    }
11
    if (hurttimer == 0)
12
    {
13
        alivetimer = 600;
14
        active = false;
15
    }
16
    if (hurttimer > 6)
17
    {
18
        if (hitdir == 0)
19
        {
20
            repeat (10)
21
            {
22
                if (!place_meeting(x, y + 1, obj_board_solid))
23
                    y += 1;
24
                else
25
                    break;
26
            }
27
        }
28
        if (hitdir == 1)
29
        {
30
            repeat (10)
31
            {
32
                if (!place_meeting(x + 1, y, obj_board_solid))
33
                    x += 1;
34
                else
35
                    break;
36
            }
37
        }
38
        if (hitdir == 2)
39
        {
40
            repeat (10)
41
            {
42
                if (!place_meeting(x, y - 1, obj_board_solid))
43
                    y -= 1;
44
                else
45
                    break;
46
            }
47
        }
48
        if (hitdir == 3)
49
        {
50
            repeat (10)
51
            {
52
                if (!place_meeting(x - 1, y, obj_board_solid))
53
                    x -= 1;
54
                else
55
                    break;
56
            }
57
        }
58
    }
59
}
60
if (sprite_index != spr___no)
61
    draw_self_board();
62
if (state == "disappear")
63
{
64
    
scr_board_marker
scr_board_marker

function
scr_board_marker()
{ var _thismarker = instance_create(argument0, argument1, obj_board_marker); _thismarker.sprite_index = argument2; _thismarker.image_xscale = 2; _thismarker.image_yscale = 2; if (argument_count >= 4) _thismarker.image_speed = argument3; if (argument_count >= 5) { if (argument4 != -1) _thismarker.depth = argument4; } if (argument_count >= 6) _thismarker.image_xscale = argument5; if (argument_count >= 6) _thismarker.image_yscale = argument5; if (argument_count >= 7) _thismarker.animateonce = argument6; return _thismarker; }
(x, y, spr___laugh, 0.4, depth, 2, 1);
65
    instance_create(x, y, obj_create_candy);
66
    instance_destroy();
67
}