Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_spotlightlaser_controller_Step_0

(view raw script w/o annotations or w/e)
1
if (con == 0)
2
{
3
    timer++;
4
    if (side == "below" && timer == 1)
5
        y = (cameray() + cameraheight()) - 140;
6
    if (timer <= 20)
7
        x = lerp(xstart, 0, timer / 20);
8
    if (timer == 30)
9
    {
10
        timer = 0;
11
        con = 1;
12
    }
13
}
14
if (con == 1)
15
{
16
    timer++;
17
    if (timer == 1)
18
    {
19
        snd_play(snd_spearappear);
20
        if (side == "above")
21
        {
22
            laser1 = instance_create_depth(x + spot1x, y + 50, depth - 1, obj_spotlightlaser);
23
            laser1.image_angle = spot1angle;
24
            laser2 = instance_create_depth(x + spot2x, y + 50, depth - 1, obj_spotlightlaser);
25
            laser2.image_angle = spot2angle;
26
            laser3 = instance_create_depth(x + spot3x, y + 50, depth - 1, obj_spotlightlaser);
27
            laser3.image_angle = spot3angle;
28
        }
29
        else
30
        {
31
            laser1 = instance_create_depth(x + spot1x, y - 12, depth - 1, obj_spotlightlaser);
32
            laser1.image_angle = spot1angle + 180;
33
            laser2 = instance_create_depth(x + spot2x, y - 12, depth - 1, obj_spotlightlaser);
34
            laser2.image_angle = spot2angle + 180;
35
            laser3 = instance_create_depth(x + spot3x, y - 12, depth - 1, obj_spotlightlaser);
36
            laser3.image_angle = spot3angle + 180;
37
        }
38
    }
39
    if (timer > 1 && !i_ex(obj_spotlightlaser))
40
    {
41
        timer = 0;
42
        con = 2;
43
    }
44
}
45
if (con == 2)
46
{
47
    timer++;
48
    if (side == "above")
49
        y -= 20;
50
    else
51
        y += 20;
52
    if (timer == 10)
53
        instance_destroy();
54
}