Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_lightsource_window_Step_0

(view raw script w/o annotations or w/e)
1
if (init == 0)
2
{
3
    init = 1;
4
    var _stretch = instance_exists(obj_window_shadow_maker) ? obj_window_shadow_maker.stretch : 0;
5
    if (!wall)
6
    {
7
        if (_stretch > 1)
8
        {
9
            y += (sprite_height * (_stretch - 1));
10
            image_yscale *= _stretch;
11
        }
12
        var _ydiff = (sprite_height - abs(sprite_height)) / 2;
13
        var _lightCaster = instance_create(x, y + (_ydiff * 2) + 8, obj_darkness_window_light);
14
        _lightCaster.sprite_index = sprite_index;
15
        _lightCaster.image_index = 2;
16
        _lightCaster.image_xscale = image_xscale;
17
        _lightCaster.image_yscale = abs(image_yscale);
18
        _lightCaster.depth = depth;
19
    }
20
}