Deltarune (Chapter 5) script viewer

← back to main script listing

gml_Object_obj_blocktree_pink_bg_Create_0

(view raw script w/o annotations or w/e)
1
event_inherited();
2
scr_depth
scr_depth

function
scr_depth(arg0 = id, arg1 = 0)
{ with (arg0) depth = 100000 - ((y * 10) + (sprite_height * 10) + (arg1 * 10)); }
();
3
siner = 0;
4
siner = random(600);
5
blocktimer = 0;
6
image_speed = 0;
7
spec = 0;
8
remdepth = depth;
9
xstart += (0.5 * sprite_width);
10
ystart += (0.75 * sprite_height);
11
shrink_current = 0;
12
xscale_start = image_xscale;
13
yscale_start = image_yscale;
14
growsound = -4;
15
con = 0;
16
leaf_dir = 0;
17
can_shrink = image_xscale < 2 && image_yscale < 2;
18
19
water = function(arg0)
20
{
21
    if (!arg0)
22
        shrink_current = 0;
23
    if (!arg0 && image_xscale < 2)
24
    {
25
        if (growsound == -4)
26
            growsound = snd_loop(snd_chain_wave);
27
        x = lerp(xstart, xstart - (sprite_get_width(sprite_index) * 0.5), image_xscale);
28
        y = lerp(ystart, ystart - (sprite_get_height(sprite_index) * 0.75), image_yscale);
29
        image_xscale = 
scr_approach
scr_approach

function
scr_approach(arg0, arg1, arg2)
{ if (arg0 < arg1) { arg0 += arg2; if (arg0 > arg1) return arg1; } else { arg0 -= arg2; if (arg0 < arg1) return arg1; } return arg0; }
(image_xscale, 2, 0.01);
30
        image_yscale = 
scr_approach
scr_approach

function
scr_approach(arg0, arg1, arg2)
{ if (arg0 < arg1) { arg0 += arg2; if (arg0 > arg1) return arg1; } else { arg0 -= arg2; if (arg0 < arg1) return arg1; } return arg0; }
(image_yscale, 2, 0.01);
31
        snd_pitch(growsound, image_xscale / 2);
32
        snd_volume(growsound, 1, 1);
33
    }
34
};