Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_susiezilla_multiexplosion_Step_0

(view raw script w/o annotations or w/e)
1
if ((timer % frequency) == 0)
2
{
3
    angle = (angle + random_range(30, 330)) % 360;
4
    var _length = random(size);
5
    var _xx = lengthdir_x(_length, angle);
6
    var _yy = lengthdir_x(_length, angle);
7
    if (timer == lifetime)
8
    {
9
        _xx = 0;
10
        _yy = 0;
11
    }
12
    else
13
    {
14
        _xx += 25;
15
        _yy += 25;
16
    }
17
    var fx = instance_create(x + _xx, y + _yy, obj_animation);
18
    fx.sprite_index = spr_explosion_round;
19
    fx.image_xscale = (timer == lifetime) ? 2 : 1;
20
    fx.image_yscale = (timer == lifetime) ? 2 : 1;
21
    fx.image_speed = 0.5;
22
    fx.depth = (timer == lifetime) ? (depth - 1) : depth;
23
    if (lastSound != 0)
24
        audio_stop_sound(lastSound);
25
    lastsound = snd_play_pitch(snd_explosion_firework, 1.1 + random(0.4));
26
    if (timer == lifetime)
27
        instance_destroy();
28
}
29
timer++;