Deltarune (Chapter 5) script viewer

← back to main script listing

gml_Object_obj_bush_leaf_manager_Step_0

(view raw script w/o annotations or w/e)
1
if (!active && count > 0)
2
{
3
    
scr_array_destroy
scr_array_destroy

function
scr_array_destroy(arg0, arg1 = -1)
{ var _size = arg1; if (arg1 == -1) _size = array_length(arg0); for (var i = 0; i < _size; i++) safe_delete(arg0[i]); arg0 = []; return arg0; }
(leaves, count);
4
    count = 0;
5
}
6
if (!active || count >= maximum)
7
    exit;
8
timer++;
9
if (timer >= rate)
10
{
11
    var _width = (cos((count + 6) / 12) * 18) + 4;
12
    var _side = round_to_multiple(sin(count / 2) * _width, 2);
13
    var _leaf = instance_create(x + _side, y - round_to_multiple(count, 2), obj_bush_leaf);
14
    leaves[count] = _leaf;
15
    count++;
16
    timer = 0;
17
    _leaf.depth = depth - count;
18
    if (rate <= 0)
19
    {
20
        _leaf = instance_create(x - _side, y - round_to_multiple(count, 2), obj_bush_leaf);
21
        leaves[count] = _leaf;
22
        count++;
23
        _leaf.depth = depth - count;
24
    }
25
    spawner += rate;
26
    rate = lerp(max_rate, 0, 
scr_ease_in
scr_ease_in

function
scr_ease_in(arg0, arg1)
{ if (arg1 < -3 || arg1 > 7) return arg0; switch (arg1) { case -3: return ease_in_bounce(arg0, 0, 1, 1); case -2: return ease_in_elastic(arg0, 0, 1, 1); case -1: var _s = 1.70158; return arg0 * arg0 * (((_s + 1) * arg0) - _s); case 0: return arg0; case 1: return -cos(arg0 * 1.5707963267948966) + 1; case 6: return power(2, 10 * (arg0 - 1)); case 7: return -(sqrt(1 - sqr(arg0)) - 1); default: return power(arg0, arg1); } }
(spawner / 30, 2));
27
}