Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_overworld_knight_sword1_Step_0

(view raw script w/o annotations or w/e)
1
y = cameray() + ypos;
2
if (image_alpha < 1)
3
{
4
    ypos -= 1;
5
    image_alpha += 0.1;
6
}
7
if ((timer < 18 && obj_mainchara.y > 3660) || vanish)
8
{
9
    vanish = true;
10
    image_alpha -= 0.25;
11
    if (image_alpha <= 0)
12
        instance_destroy();
13
    exit;
14
}
15
timer += 1;
16
if (timer == 1)
17
{
18
    snd_stop(snd_knight_jump_quick);
19
    snd_play_x(snd_knight_jump_quick, 0.5, 1.3);
20
}
21
if (timer >= 10 && timer < 16)
22
{
23
    image_blend = merge_color(c_white, c_red, (timer - 10) / 6);
24
    ypos = lerp(ypos, 38, (timer - 10) / 6);
25
}
26
if (timer == 16)
27
{
28
    con = y;
29
    ypos += 600;
30
    snd_stop(snd_knight_cut2);
31
    snd_play_x(snd_knight_cut2, 0.5, 1.3);
32
}
33
if (timer == 18)
34
{
35
    if (global.inv < 0 && i_ex(obj_mainchara) && x > (obj_mainchara.x + 6) && x < (obj_mainchara.x + 34))
36
        event_user(5);
37
}
38
if (timer == 18)
39
    instance_destroy();