Deltarune (Chapter 2) script viewer

← back to main script listing

gml_Object_obj_ch2_capsule_Draw_0

(view raw script w/o annotations or w/e)
1
if (con == 0 && visible == 1)
2
{
3
    draw_self();
4
    repeattimer--;
5
    if (repeattimer <= 0)
6
    {
7
        repeattimer = 8;
8
        if (main)
9
            noise = snd_play(snd_chain_extend);
10
    }
11
}
12
if (con == 1)
13
{
14
    if (extendtimer == 0)
15
    {
16
        if (main)
17
            snd_play(snd_swing);
18
    }
19
    extendtimer += 0.25;
20
    if (extendtimer >= 4)
21
    {
22
        con = 2;
23
        if (main)
24
            snd_play(snd_impact);
25
    }
26
    else
27
    {
28
        draw_sprite_ext(spr_cutscene_09_capsule_extend, extendtimer, x, y, image_yscale, image_yscale, image_angle, image_blend, image_alpha);
29
    }
30
}
31
if (con == 2)
32
{
33
    image_index = 0;
34
    image_speed = 0;
35
    sprite_index = spr_cutscene_09_capsule_extended;
36
    imagetimer++;
37
    if (imagetimer >= 2)
38
    {
39
        
scr_afterimage
scr_afterimage

function
scr_afterimage()
{ afterimage = instance_create(x, y, obj_afterimage); afterimage.sprite_index = sprite_index; afterimage.image_index = image_index; afterimage.image_blend = image_blend; afterimage.image_speed = 0; afterimage.depth = depth; afterimage.image_xscale = image_xscale; afterimage.image_yscale = image_yscale; afterimage.image_angle = image_angle; return afterimage; }
();
40
        imagetimer = 0;
41
    }
42
    siner++;
43
    draw_sprite_ext(spr_cutscene_09_capsule_extended, 0, x, y, image_yscale, image_yscale, image_angle, image_blend, image_alpha);
44
    draw_sprite_ext(spr_cutscene_09_capsule_extended, 1, x, y, image_yscale, image_yscale, image_angle, image_blend, 0.1 + (sin(siner / 2) * 0.1));
45
}