Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_gold_cat_aura_Step_0

(view raw script w/o annotations or w/e)
1
if (!init)
2
{
3
    image_alpha = 0.5;
4
    thresh = (level * 12) - 40;
5
    radius = 60 + (level * 15);
6
    init = true;
7
}
8
timer++;
9
if (active)
10
{
11
    with (obj_meteor)
12
    {
13
        if (point_distance(x, y, other.x, other.y) <= other.radius)
14
        {
15
            var _a = instance_create(x, y, obj_green_cat);
16
            _a.chance = other.level;
17
            if (_a.x > 0)
18
            {
19
                _a.hspeed = point_distance(x, y, room_width, y) / 32;
20
                _a.friction = 0.2;
21
            }
22
            scr_sparkle_colour(4, 32768);
23
            instance_destroy();
24
        }
25
    }
26
}
27
if (timer >= thresh)
28
{
29
    active = 0;
30
    snd_volume(mysound, image_alpha, 0);
31
}
32
if (active == 0)
33
{
34
    image_alpha -= 0.025;
35
    if (image_alpha <= 0)
36
        instance_destroy();
37
}