Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_burgerpants_runaway_Step_0

(view raw script w/o annotations or w/e)
1
if (init == 0)
2
{
3
    init = 1;
4
    standmarker = 
scr_marker
scr_marker

function
scr_marker(arg0, arg1, arg2)
{ thismarker = instance_create(arg0, arg1, obj_marker); with (thismarker) { sprite_index = arg2; image_speed = 0; } return thismarker; }
(x, y, spr_npc_burgerpants_stand_rain_empty);
5
    with (standmarker)
6
        
scr_depth
scr_depth

function
scr_depth(arg0 = id, arg1 = 0)
{ with (arg0) depth = 100000 - ((y * 10) + (sprite_height * 10) + (arg1 * 10)); }
();
7
    xstart = x;
8
}
9
if (con == 0)
10
{
11
    timer++;
12
    if (timer == 14)
13
        depth = standmarker.depth + 1;
14
    if (timer == 16)
15
        x += 320;
16
    if (timer == 128)
17
    {
18
        x = xstart;
19
        sprite_index = spr_npc_burgerpants_stand_rain_cookie;
20
        con = 1;
21
    }
22
}
23
if (
scr_debug
scr_debug

function
scr_debug()
{ if (global.debug == 1) return 1; }
())
24
{
25
    if (keyboard_check_pressed(ord("2")))
26
        con = 2;
27
}
28
if (con == 1)
29
{
30
    if (image_speed > 0)
31
    {
32
        cookie_timer++;
33
        if ((cookie_timer % 15) == 1)
34
            snd_play_x(snd_splat, 0.3, 2);
35
    }
36
}
37
if (con == 2)
38
{
39
    x += 320;
40
    image_alpha = 0;
41
}
42
var make = false;
43
if (x != xprevious || y != yprevious)
44
    make = true;
45
var count = 120;
46
if (make)
47
{
48
    for (var i = 0; i < count; i++)
49
    {
50
        var xval = lerp(xprevious, x, i / count);
51
        var yval = lerp(yprevious, y, i / count);
52
        var afterimage = 
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; }
();
53
        afterimage.sprite_index = blursprite;
54
        afterimage.x = xval;
55
        afterimage.y = yval;
56
        afterimage.fadeSpeed = 0.12;
57
        afterimage.image_alpha = (i / 5 / count) + afterimage.fadeSpeed;
58
        afterimage.depth = depth + 1;
59
    }
60
}