Deltarune (Chapter 2) script viewer

← back to main script listing

gml_Object_obj_omawaroid_vaccine_Step_0

(view raw script w/o annotations or w/e)
1
d = instance_nearest(x, y, obj_viro_needle);
2
if (d != -4 && d.active && x < d.x)
3
{
4
    var distance = point_distance(x, y, d.x, d.y);
5
    if (distance <= 80)
6
        y = 
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); }
(y, d.y, (80 - distance) / 5);
7
}
8
if (x > obj_growtangle.x && image_alpha == 0)
9
    instance_destroy();