Deltarune (Chapter 5) script viewer

← back to main script listing

gml_Object_obj_climb_flamegenerator_Step_0

(view raw script w/o annotations or w/e)
1
if (!init)
2
{
3
    rate = r_rate;
4
    timer = r_timer;
5
    dir = r_dir;
6
    movespeed = r_movespeed;
7
    lifetime = r_lifetime;
8
    init = 1;
9
}
10
if (active)
11
{
12
    if (global.interact == 0)
13
    {
14
        timer++;
15
        if ((timer % rate) == 0)
16
        {
17
            var xoff = floor(random_range(-r_spawn_area_width * 0.5, r_spawn_area_width * 0.5)) * 40;
18
            var yoff = floor(random_range(-r_spawn_area_height * 0.5, r_spawn_area_height * 0.5)) * 40;
19
            var bul = instance_create(x + 20 + xoff, y + 20 + yoff, obj_climb_flamefalling);
20
            bul.dir = dir;
21
            with (bul)
22
                
scr_depth
scr_depth

function
scr_depth(arg0 = id, arg1 = 0)
{ with (arg0) depth = 100000 - ((y * 10) + (sprite_height * 10) + (arg1 * 10)); }
();
23
            bul.movespeed = movespeed;
24
            bul.lifetime = lifetime;
25
            bul.bounceshift = r_bounceshift;
26
            bouncedir = -bouncedir;
27
            bul.bouncedir = bouncedir;
28
        }
29
    }
30
}