Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_sprite_flasher_Draw_0

(view raw script w/o annotations or w/e)
1
if (!init)
2
{
3
    if (fade_in == 0)
4
    {
5
        con = 1;
6
        image_alpha = 1;
7
    }
8
    init = true;
9
}
10
if (con == 0)
11
{
12
    image_alpha = timer / fade_in;
13
    timer++;
14
    if (timer >= fade_in)
15
    {
16
        timer = 0;
17
        con++;
18
    }
19
}
20
else if (con == 1)
21
{
22
    image_alpha = 1;
23
    if (timer >= lifetime)
24
    {
25
        if (fade_out == 0)
26
        {
27
            con = 3;
28
        }
29
        else
30
        {
31
            timer = fade_out;
32
            con++;
33
        }
34
    }
35
}
36
else if (con == 2)
37
{
38
    image_alpha = timer / fade_out;
39
    timer--;
40
    if (timer <= 0)
41
        con = 3;
42
}
43
else if (con == 3)
44
{
45
    instance_destroy();
46
}
47
if (target != -4 && i_ex(target))
48
{
49
    d3d_set_fog(true, color, 0, 1);
50
    with (target)
51
        draw_sprite_ext(sprite_index, image_index, x, y, image_xscale, image_yscale, image_angle, image_blend, other.image_alpha);
52
    d3d_set_fog(false, c_black, 0, 0);
53
}