Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_trail_effect_Step_0

(view raw script w/o annotations or w/e)
1
if (!init)
2
{
3
    trail_surf = surface_create(room_width, room_height);
4
    init = true;
5
}
6
var _length = array_length(points);
7
with (obj_trail_point)
8
{
9
    if (owner == other.id)
10
    {
11
        life -= (1 / other.lifetime);
12
        if (life < 0)
13
        {
14
            array_resize(other.points, _length - 1);
15
            instance_destroy();
16
        }
17
    }
18
}
19
var _point = instance_create(xlast, ylast, obj_trail_point);
20
_point.owner = id;
21
_point.life = 1 - (1 / lifetime);
22
array_insert(points, 0, _point);
23
if (demo)
24
{
25
    var _angle_a = sin(siner / 20) * 45;
26
    
scr_debug_print_persistent
scr_debug_print_persistent

function
scr_debug_print_persistent(arg0, arg1)
{ } function debug_print_persistent(arg0, arg1) { } function scr_debug_delete_persistent(arg0, arg1 = false) { } function scr_debug_clear_persistent() { }
("angle", string(_angle_a));
27
    hingepos.x = camerax() + 320 + lengthdir_x(240, 270 + (sin(siner / 20) * 45));
28
    hingepos.y = cameray() + lengthdir_y(240, 270 + (sin(siner / 20) * 45));
29
    x = hingepos.x + lengthdir_x(80, (siner * 10) % 360);
30
    y = hingepos.y + lengthdir_y(80, (siner * 10) % 360);
31
    siner++;
32
}
33
ylast = y;
34
xlast = x;