Deltarune (Chapter 2) script viewer

← back to main script listing

gml_Object_obj_hangplug_spark_Step_0

(view raw script w/o annotations or w/e)
1
timer += 1;
2
if (timer <= 15)
3
{
4
    flashtimer += 1;
5
    image_alpha = abs(cos(flashtimer / 2));
6
}
7
if (timer == 15)
8
{
9
    image_alpha = 1;
10
    vspeed = 0.1;
11
    if (!snd_is_playing(snd_ultraswing))
12
    {
13
        spawn = snd_play_pitch(snd_ultraswing, 2);
14
        snd_volume(spawn, 0.6, 0);
15
    }
16
    con = 1;
17
}
18
if (con == 1)
19
{
20
    if (room == room_dw_mansion_east_4f_c)
21
    {
22
        vspeed = clamp(vspeed, 0, 18);
23
        vspeed *= 1.6;
24
    }
25
    else
26
    {
27
        vspeed = clamp(vspeed, 0, 14);
28
        vspeed *= 1.5;
29
    }
30
    if (y >= (basey + fallAmount))
31
    {
32
        y = basey + fallAmount;
33
        con = 2;
34
    }
35
}
36
if (con == 2)
37
{
38
    left = instance_create(x, y - (sprite_height / 2), obj_hangplug_sparkwave);
39
    with (left)
40
        dir = "left";
41
    right = instance_create(x, y - (sprite_height / 2), obj_hangplug_sparkwave);
42
    with (right)
43
        dir = "right";
44
    drop = snd_play_pitch(snd_battleenter, 1.5);
45
    snd_volume(drop, 0.3, 0);
46
    instance_destroy();
47
}
48
scr_depth_alt
scr_depth_alt

function
scr_depth_alt()
{ depth = 100000 - ((y * 10) + ((sprite_height - sprite_yoffset) * 10)); }
();