Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_susiezilla_missile_Step_0

(view raw script w/o annotations or w/e)
1
if (con == 0)
2
{
3
    acceleration += 1;
4
    height += acceleration;
5
    timer++;
6
    if (timer >= 50)
7
    {
8
        var x_predictive_track = (obj_susiezilla.x - 4) + ((obj_susiezilla.x - obj_susiezilla.xprevious) * (11 + irandom(12)));
9
        var y_predictive_track = (obj_susiezilla.y - 10) + ((obj_susiezilla.y - obj_susiezilla.yprevious) * (11 + irandom(12)));
10
        var x_track = choose((obj_susiezilla.x - 4 - 60) + random(120), x_predictive_track);
11
        var y_track = choose((obj_susiezilla.y - 4 - 60) + random(120), y_predictive_track);
12
        con = 1;
13
        height = 400;
14
        if (target_x != 0)
15
            x = target_x;
16
        else
17
            x = tracker ? x_track : random_range(camerax() + 40, camerax() + 600);
18
        if (target_y != 0)
19
            y = target_y;
20
        else
21
            y = tracker ? y_track : random_range(cameray() + 200, cameray() + 300);
22
        marker = instance_create(x, y, obj_susiezilla_missile_marker);
23
        alarm[0]
 = 30;
gml_Object_obj_susiezilla_missile_Alarm_0.gml

con++;
24
        image_yscale *= -1;
25
        scr_depth_pivot();
26
    }
27
}
28
if (con == 2)
29
{
30
    scr_depth_pivot();
31
    height -= 20;
32
    if (height <= 0)
33
    {
34
        instance_destroy(marker);
35
        var _explosion = instance_create(x, y + 10, obj_susiezilla_explosion);
36
        with (_explosion)
37
        {
38
            
scr_depth_alt
scr_depth_alt

function
scr_depth_alt()
{ depth = 100000 - ((y * 10) + ((sprite_height - sprite_yoffset) * 10)); }
();
39
            depth -= 70;
40
        }
41
        instance_destroy();
42
    }
43
}
44
timer++;