Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_lightsource_shrinking_Step_0

(view raw script w/o annotations or w/e)
1
siner++;
2
if (radius < targetradius)
3
{
4
    radius += 4;
5
    radius = min(radius, targetradius);
6
}
7
smallerLight = max(0, (sin(siner / 30) * 10) + radius);
8
biggerLight = max(0, (sin((siner - 10) / 30) * 10) + radius + 40);
9
scr_depth
scr_depth

function
scr_depth(arg0 = id, arg1 = 0)
{ with (arg0) depth = 100000 - ((y * 10) + (sprite_height * 10) + (arg1 * 10)); }
();
10
if (con == 0)
11
{
12
    with (collider)
13
    {
14
        if (place_meeting(x, y, obj_overworldheart))
15
            other.con = 1;
16
    }
17
}
18
else
19
{
20
    radius -= shrinkspeed;
21
    targetradius = radius;
22
    if (radius < -50)
23
        instance_destroy();
24
}