Deltarune (Chapter 2) script viewer

← back to main script listing

gml_Object_obj_maus_holes_Draw_0

(view raw script w/o annotations or w/e)
1
if (preptimer > 0)
2
{
3
    preptimer--;
4
    var invlerp = 
scr_inverselerp
scr_inverselerp

function
scr_inverselerp(arg0, arg1, arg2)
{ if (arg1 == arg0) return 0; return (arg2 - arg0) / (arg1 - arg0); }
(5, 0, preptimer);
5
    var scale = lerp(0.7, 1, invlerp);
6
    draw_sprite_ext(sprite_index, 0, x, y, scale, scale, 0, c_white, 1);
7
    if (preptimer == 0)
8
    {
9
        d = instance_create(x, y, obj_bulletparent);
10
        d.sprite_index = spr_maus_holesblack;
11
        d.depth += 3;
12
    }
13
}
14
else
15
{
16
    draw_sprite_ext(sprite_index, image_index, x + (random(shaky) * choose(1, -1)), y + (random(shaky) * choose(1, -1)), image_xscale, image_yscale, image_angle, image_blend, image_alpha);
17
}
18
shaky = 
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; }
(shaky, 0, max(0.1, shaky / 8));