Deltarune script viewer

← back to main script listing

gml_Object_obj_berdlyb_tornado_old_Draw_0

(view raw script w/o annotations or w/e)
1
if (init && image_alpha < 1)
2
{
3
    if (middespawn)
4
        image_alpha = 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); }
(image_alpha, clamp(traveldistance / 110, 0.5, 1), 0.1);
5
    else
6
        image_alpha += 0.1;
7
}
8
if (middespawn && traveldistance <= ((maxdistance / 2) + 10))
9
    image_blend = merge_color(c_gray, c_white, clamp01(scr_inverselerp
scr_inverselerp

function scr_inverselerp(arg0, arg1, arg2) { if (arg1 == arg0) return 0; return (arg2 - arg0) / (arg1 - arg0); }
((maxdistance / 2) - 10, (maxdistance / 2) + 10, traveldistance)));
10
xflip = 1;
11
if (flipTimer < 0)
12
    xflip = -1;
13
flipTimer++;
14
if (flipTimer >= flipSpeed)
15
    flipTimer = -flipSpeed;
16
draw_sprite_ext(sprite_index, 0, x, y, xflip, 1, 0, image_blend, image_alpha);