Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_board_enemy_rotaty_Step_0

(view raw script w/o annotations or w/e)
1
scr_board_enemy_step_init
scr_board_enemy_step_init

function
scr_board_enemy_step_init()
{ if (state == "init") state = "move"; }
();
2
scr_depth_board
scr_depth_board

function
scr_depth_board()
{ depth = 1000000 - ((y * 10) + ((sprite_height - sprite_yoffset) * 10)); } function scr_board_depth() {
scr_depth_board();
}
();
3
repeat (spd)
4
{
5
    if (delay < 1)
6
    {
7
        if (direction == 270)
8
        {
9
            if (!position_meeting(x + 16 + 32, y + 4, obj_board_solid))
10
            {
11
                direction = 0;
12
                delay = 8;
13
            }
14
            if (position_meeting(x + 1, y + 33, obj_board_solid))
15
            {
16
                direction = 180;
17
                delay = 4;
18
                alt = 1;
19
            }
20
            xx = x + 16 + 32;
21
            yy = y + 4;
22
            xx2 = x + 1;
23
            yy2 = y + 33;
24
        }
25
        else if (direction == 0)
26
        {
27
            if (!position_meeting(x + 4, (y + 16) - 32, obj_board_solid))
28
            {
29
                direction = 90;
30
                delay = 8;
31
            }
32
            if (position_meeting(x + 33, y, obj_board_solid))
33
            {
34
                direction = 270;
35
                delay = 4;
36
            }
37
            xx = x + 4;
38
            yy = (y + 16) - 32;
39
            xx2 = x + 33;
40
            yy2 = y;
41
        }
42
        else if (direction == 90)
43
        {
44
            if (!position_meeting((x + 16) - 32, y + 28, obj_board_solid))
45
            {
46
                direction = 180;
47
                delay = 8;
48
            }
49
            if (position_meeting(x + 4, y - 1, obj_board_solid))
50
            {
51
                direction = 0;
52
                delay = 4;
53
            }
54
            xx = (x + 16) - 32;
55
            yy = y + 28;
56
            xx2 = x + 4;
57
            yy2 = y - 1;
58
        }
59
        else if (direction == 180)
60
        {
61
            if (!position_meeting(x + 28, y + 16 + 32, obj_board_solid))
62
            {
63
                direction = 270;
64
                delay = 8;
65
            }
66
            if (position_meeting(x - 1, y + 1, obj_board_solid))
67
            {
68
                direction = 90;
69
                delay = 4;
70
            }
71
            xx = x + 28;
72
            yy = y + 16 + 28;
73
            xx2 = x - 1;
74
            yy2 = y;
75
        }
76
    }
77
    x += lengthdir_x(1, direction);
78
    y += lengthdir_y(1, direction);
79
}
80
if (delay > 0)
81
    delay--;