Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_gh_fireball_hop_Step_1

(view raw script w/o annotations or w/e)
1
var prev_y = y;
2
timer += ((pi / cycle_length) * rate);
3
y = basey - (max(0, abs(sin(timer))) * width);
4
if (sprite_index == spr_ghost_house_pumpkin_vertical)
5
    image_index = 
scr_approach
scr_approach

function
scr_approach(arg0, arg1, arg2)
{ if (arg0 < arg1) { arg0 += arg2; if (arg0 > arg1) return arg1; } else { arg0 -= arg2; if (arg0 < arg1) return arg1; } return arg0; }
(image_index, 2.01 + (2 * sign(y - prev_y)), 1);