Deltarune (Chapter 2) script viewer

← back to main script listing

gml_Object_o_coaster_lightning_Step_0

(view raw script w/o annotations or w/e)
1
if (con == -2)
2
{
3
    timer++;
4
    if (timer >= waittime)
5
    {
6
        con = 0;
7
        x += 50;
8
        vspeed = 10;
9
        friction = -1;
10
    }
11
}
12
if (con == 0 && y >= (ystart - vspeed))
13
{
14
    for (i = 0; i < 4; i++)
15
    {
16
        lit = instance_create(x - 40, y, o_coaster_jama);
17
        lit.sprite_index = spr_coaster_lightning;
18
        lit.image_speed = 0.25;
19
        lit.friction = 0.2;
20
        lit.hspeed = -4 + (i * 4);
21
        lit.type = 1;
22
        lit.waitamount = litwaittime;
23
        if (i == 3)
24
        {
25
            lit.visible = 0;
26
            lit.moveberd = 1;
27
        }
28
    }
29
    vspeed = 0;
30
    image_angle = 0;
31
    image_speed = 0;
32
    image_index = 0;
33
    image_speed = 0.5;
34
    y -= 20;
35
    sprite_index = spr_coaster_explosion;
36
    con = 1;
37
}
38
if (con == 1)
39
{
40
    if (image_index >= 3)
41
        instance_destroy();
42
}