Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_titan_climb_spawn_controller_Create_0

(view raw script w/o annotations or w/e)
1
spawn_list = [];
2
timer = 0;
3
pulse_siner = 0;
4
5
create_spawn = function()
6
{
7
    _index = 0;
8
    _increment = 1.0471975511965976;
9
    _radius = 180;
10
    spawn_pos = [];
11
    spawn_pos[0] = [24, 16, -44, 30, -20, -10];
12
    spawn_pos[1] = [10, -30, 10, -40, -30, 20];
13
    for (var a = 0; a < (2 * pi); a += _increment)
14
    {
15
        var xx = camerax() + (view_wport[0] / 2) + (cos(a) * _radius);
16
        var yy = cameray() + (view_hport[0] / 2) + (sin(a) * _radius);
17
        var y_offset = spawn_pos[0][a];
18
        var x_offset = spawn_pos[1][a];
19
        spawn_list[_index] = instance_create(xx + x_offset, yy + y_offset, obj_titan_climb_spawn);
20
        spawn_list[_index].image_xscale = -2;
21
        spawn_list[_index].image_angle = point_direction(xx, yy, camerax() + (view_wport[0] / 2), yy);
22
        if (spawn_list[_index].image_angle >= 180)
23
            spawn_list[_index].image_yscale = -2;
24
        spawn_list[_index].depth = 8970;
25
        var fade_in_time = 1 + (_index * 15);
26
        with (spawn_list[_index])
27
alarm[0]
28
        _index++;
29
    }
30
};
31
32
hide_spawn = function()
33
{
34
    for (var i = 0; i < array_length(spawn_list); i++)
35
    {
36
        var spawn = spawn_list[i];
37
        with (spawn)
38
            fade_out();
39
    }
40
};