Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_gh_fireball_bouncy_Step_1

(view raw script w/o annotations or w/e)
1
if (!(collision_circle(x - 1, y, sprite_width / 2, obj_gh_bouncebarrier, true, true) || collision_circle(x - 1, y, sprite_width / 2, obj_battlesolid, true, true)))
2
{
3
    if (collision_circle((x + hspeed) - 1, y, sprite_width / 2, obj_gh_bouncebarrier, true, true) || collision_circle((x + hspeed) - 1, y, sprite_width / 2, obj_battlesolid, true, true))
4
        hspeed *= -1;
5
    if (collision_circle(x - 1, y + vspeed, sprite_width / 2, obj_gh_bouncebarrier, true, true) || collision_circle(x - 1, y + vspeed, sprite_width / 2, obj_battlesolid, true, true))
6
        vspeed *= -1;
7
    if (collision_circle((x - 1) + hspeed, y + vspeed, sprite_width / 2, obj_gh_bouncebarrier, true, true) || collision_circle((x - 1) + hspeed, y + vspeed, sprite_width / 2, obj_battlesolid, true, true))
8
        hspeed *= -1;
9
}
10
if (sprite_index == spr_ghost_house_pumpkin_horizontal)
11
    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 - (2 * sign(hspeed)), 0.2);
12
else if (sprite_index == spr_ghost_house_pumpkin_vertical)
13
    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 - (2 * sign(vspeed)), 0.2);
14
if (iris)
15
    iris_dir += (angle_difference(direction, iris_dir) / 5);