Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_lightsource_heartlight_Step_2

(view raw script w/o annotations or w/e)
1
if (i_ex(obj_heart))
2
{
3
    heart_active = true;
4
    if (obj_heart.sprite_index == spr_dodgeheart_small)
5
    {
6
        x = obj_heart.x + 4;
7
        y = obj_heart.y + 4;
8
    }
9
    else if (obj_heart.sprite_index == spr_dodgeheart_long)
10
    {
11
        x = obj_heart.x + 14;
12
        y = obj_heart.y + 4;
13
    }
14
    else
15
    {
16
        x = obj_heart.x + 10;
17
        y = obj_heart.y + 10;
18
    }
19
}
20
else
21
{
22
    heart_active = false;
23
}
24
if (heart_active)
25
    current_radius = 
scr_movetowards
scr_movetowards

function
scr_movetowards(arg0, arg1, arg2)
{ if (arg0 == arg1) return arg0; else if (arg0 > arg1) return max(arg0 - arg2, arg1); else return min(arg0 + arg2, arg1); } function scr_obj_movetowards_obj(arg0, arg1, arg2 = 0, arg3 = 0) { scr_obj_movetowards_point(arg0.x + arg2, arg0.y + arg3, arg1); } function scr_obj_movetowards_point(arg0, arg1, arg2) { var _distance = point_distance(x, y, arg0, arg1); if (arg2 >= _distance) { x = arg0; y = arg1; } else { var _direction = point_direction(x, y, arg0, arg1); x += lengthdir_x(arg2, _direction); y += lengthdir_y(arg2, _direction); } }
(current_radius, radius, radius / 15);
26
else
27
    current_radius = 
scr_movetowards
scr_movetowards

function
scr_movetowards(arg0, arg1, arg2)
{ if (arg0 == arg1) return arg0; else if (arg0 > arg1) return max(arg0 - arg2, arg1); else return min(arg0 + arg2, arg1); } function scr_obj_movetowards_obj(arg0, arg1, arg2 = 0, arg3 = 0) { scr_obj_movetowards_point(arg0.x + arg2, arg0.y + arg3, arg1); } function scr_obj_movetowards_point(arg0, arg1, arg2) { var _distance = point_distance(x, y, arg0, arg1); if (arg2 >= _distance) { x = arg0; y = arg1; } else { var _direction = point_direction(x, y, arg0, arg1); x += lengthdir_x(arg2, _direction); y += lengthdir_y(arg2, _direction); } }
(current_radius, -40, radius / 15);