Deltarune (Chapter 2) script viewer

← back to main script listing

gml_Object_obj_sneo_dollar_Step_0

(view raw script w/o annotations or w/e)
1
if (fade == 1)
2
{
3
    image_alpha -= 0.1;
4
    speed = 0;
5
    if (image_alpha <= 0)
6
        instance_destroy();
7
}
8
event_inherited();
9
if (!instance_exists(obj_sneo_final_forme))
10
    exit;
11
if (x > ((obj_sneo_final_forme.x + obj_sneo_final_forme.mouthx) - 50))
12
    y += clamp((obj_sneo_final_forme.y + obj_sneo_final_forme.mouthy) - y, -5, 5);
13
if (x < ((obj_sneo_final_forme.x + obj_sneo_final_forme.mouthx) - 10))
14
{
15
    direction = point_direction(x, y, obj_sneo_final_forme.x + obj_sneo_final_forme.mouthx, obj_sneo_final_forme.y + obj_sneo_final_forme.mouthy);
16
    friction = -0.1;
17
}
18
var _mouthrelative = obj_sneo_final_forme.x + obj_sneo_final_forme.mouthx;
19
var _scalesize = lerp(startscale, 1, clamp(
scr_inverselerp
scr_inverselerp

function
scr_inverselerp(arg0, arg1, arg2)
{ if (arg1 == arg0) return 0; return (arg2 - arg0) / (arg1 - arg0); }
(_mouthrelative - 200, _mouthrelative - 50, x), 0, 1));
20
image_xscale = _scalesize;
21
image_yscale = _scalesize;
22
if (x > (obj_sneo_final_forme.x + obj_sneo_final_forme.mouthx + 50))
23
{
24
    instance_destroy();
25
    snd_play(snd_swallow);
26
}