Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_spotlightlaser_Draw_0

(view raw script w/o annotations or w/e)
1
if (con == 0)
2
{
3
    if (image_alpha < 1)
4
    {
5
        image_alpha += 0.16666666666666666;
6
    }
7
    else
8
    {
9
        timer++;
10
        if (timer == 30)
11
        {
12
            timer = 0;
13
            con = 1;
14
            snd_stop(snd_sneo_overpower);
15
            snd_play_x(snd_sneo_overpower, 0.7, 1.1);
16
            snd_loop(snd_sneo_overpower);
17
        }
18
    }
19
}
20
if (con == 1)
21
{
22
    siner++;
23
    laser_xscale = 0.4 + (sin(siner / 2) * 0.2);
24
    laser_yscale += (1/3);
25
    timer++;
26
    if (timer == 34)
27
    {
28
        timer = 0;
29
        con = 2;
30
        snd_volume(snd_sneo_overpower, 0, 10);
31
    }
32
}
33
if (con == 2)
34
{
35
    laser_xscale = lerp(laser_xscale, 0, 0.3);
36
    image_alpha -= 0.1;
37
    if (image_alpha < 0)
38
        instance_destroy();
39
}
40
gpu_set_blendmode(bm_add);
41
draw_sprite_ext(sprite_index, image_index, x, y, image_xscale, image_yscale, image_angle, c_red, image_alpha);
42
gpu_set_blendmode(bm_normal);
43
draw_sprite_ext(sprite_index, image_index, x, y, laser_xscale, laser_yscale, image_angle, image_blend, image_alpha);