Deltarune (Chapter 2) script viewer

← back to main script listing

gml_Object_obj_beatbullet_simple_Step_0

(view raw script w/o annotations or w/e)
1
if (dir == 0)
2
    horizontal = false;
3
else
4
    horizontal = true;
5
if (instance_exists(obj_MovingPlat_dw_cyber_music_final))
6
{
7
    xx = obj_MovingPlat_dw_cyber_music_final.x;
8
    yy = obj_MovingPlat_dw_cyber_music_final.y;
9
}
10
if (init == 0)
11
{
12
    xx = obj_MovingPlat_dw_cyber_music_final.x + 38;
13
    yy = 152;
14
    mody = 232;
15
    rx = (xx - 50 - 38) + 2;
16
    lx = (((xx + 330) - 38) + 2) - 4;
17
    if (x == lx)
18
        dir = "left";
19
    if (x == rx)
20
        dir = "right";
21
    if (y == yy)
22
        dir = "down";
23
    if (dir != "down")
24
        horizontal = true;
25
    else
26
        horizontal = false;
27
    if (dir == "left")
28
        image_angle = -90;
29
    if (dir == "right")
30
        image_angle = 90;
31
    glow = instance_create(x, y, obj_beatbullet_simpleglow);
32
    glow.image_angle = image_angle;
33
    glow.sprite_index = sprite_index;
34
    glow.depth = depth + 1;
35
    init = 1;
36
}
37
if (con == 0)
38
{
39
    timer++;
40
    image_alpha *= 1.5;
41
    if (timer == 16 && horizontal == true)
42
    {
43
        if (dir == "down")
44
            
scr_move_to_point_over_time
scr_move_to_point_over_time

function
scr_move_to_point_over_time(arg0, arg1, arg2)
{ _mmm = instance_create(x, y, obj_move_to_point); _mmm.target = id; _mmm.movex = arg0; _mmm.movey = arg1; _mmm.movemax = arg2; return _mmm; }
(x, 400, traveltime);
45
        if (dir == "left")
46
            
scr_move_to_point_over_time
scr_move_to_point_over_time

function
scr_move_to_point_over_time(arg0, arg1, arg2)
{ _mmm = instance_create(x, y, obj_move_to_point); _mmm.target = id; _mmm.movex = arg0; _mmm.movey = arg1; _mmm.movemax = arg2; return _mmm; }
(xx, y, traveltime);
47
        if (dir == "right")
48
            
scr_move_to_point_over_time
scr_move_to_point_over_time

function
scr_move_to_point_over_time(arg0, arg1, arg2)
{ _mmm = instance_create(x, y, obj_move_to_point); _mmm.target = id; _mmm.movex = arg0; _mmm.movey = arg1; _mmm.movemax = arg2; return _mmm; }
(xx + 278, y, traveltime);
49
        con = 1;
50
    }
51
}
52
if (dir == "down" && y > 399)
53
    instance_destroy();
54
if (dir == "left" && x <= xx)
55
    instance_destroy();
56
if (dir == "right" && x >= (xx + 278))
57
    instance_destroy();
58
if (con == 0 && place_meeting(x, y, obj_beatbullet_simple))
59
    instance_destroy();