Deltarune (Chapter 2) script viewer

← back to main script listing

gml_Object_obj_sneo_elevator_arm_Step_0

(view raw script w/o annotations or w/e)
1
if (!instance_exists(obj_sneo_bulletcontroller))
2
{
3
    instance_destroy();
4
    exit;
5
}
6
siner++;
7
image_angle = 270 + (sin(siner / 6) * 8);
8
var xx = camerax() + camerawidth();
9
if (con == 0)
10
{
11
    movetimer++;
12
    x = lerp(xx + 100, xx + 10, movetimer / 10);
13
    if (movetimer == 10)
14
    {
15
        movetimer = 0;
16
        con = 1;
17
    }
18
}
19
if (con == 1)
20
    x = xx + 10;
21
if (con == 2)
22
{
23
    movetimer++;
24
    x = lerp(xx + 10, xx + 100, movetimer / 10);
25
    if (movetimer == 10)
26
        instance_destroy();
27
}
28
timer++;
29
if ((timer == 20 && obj_sneo_bulletcontroller.difficulty == 0) || (timer == 6 && obj_sneo_bulletcontroller.difficulty != 0))
30
{
31
    d = instance_create(x - 90, y, obj_sneo_biglaser_elevator);
32
    d.direction = -180;
33
    d.image_angle = -180;
34
    d.depth -= 1;
35
    d.parent = id;
36
}
37
if ((timer == 39 && obj_sneo_bulletcontroller.difficulty == 0) || (timer == 25 && obj_sneo_bulletcontroller.difficulty != 0))
38
{
39
    con = 2;
40
    if (lastType == -1)
41
        obj_sneo_bulletcontroller.arm1 = -1;
42
    if (lastType == 0)
43
        obj_sneo_bulletcontroller.arm2 = -1;
44
    if (lastType == 1)
45
        obj_sneo_bulletcontroller.arm3 = -1;
46
}