Deltarune (Chapter 5) script viewer

← back to main script listing

gml_Object_obj_cliff_crater_windtrail_Draw_0

(view raw script w/o annotations or w/e)
1
draw_primitive_begin(pr_trianglestrip);
2
var _in_foreground = false;
3
var _arraysize = array_length(points);
4
var i = _arraysize - 1;
5
while (i >= 0)
6
{
7
    if (i == (_arraysize - 1))
8
    {
9
        with (points[i])
10
        {
11
            if (foreground)
12
                _in_foreground = true;
13
            else
14
                draw_vertex_color(x, y, other.end_color, clamp01(other.end_alpha + min(0, other.lifetime / 10)));
15
        }
16
    }
17
    else if (!_in_foreground || !foreground)
18
    {
19
        var _prog = i / (_arraysize - 1);
20
        var _size = sin(_prog * pi) * (_arraysize / child_lifetime) * 4;
21
        if (lifetime < 14)
22
            _size *= max(0, lifetime / 14);
23
        var _col = merge_color(start_color, end_color, _prog);
24
        var _alpha = clamp01(lerp(start_alpha, end_alpha, _prog) + min(0, lifetime / 10));
25
        with (points[i])
26
        {
27
            var _yy = lerp(y, other.ystart, other.owner.ys[0]);
28
            draw_vertex_color(x - (sidex * _size), _yy - (sidey * _size), _col, _alpha);
29
            draw_vertex_color(x + (sidex * _size), _yy + (sidey * _size), _col, _alpha);
30
        }
31
    }
32
    i--;
33
}
34
draw_vertex_color(x, y, start_color, clamp01(start_alpha + min(0, lifetime / 10)));
35
draw_primitive_end();