Deltarune (Chapter 2) script viewer

← back to main script listing

gml_Object_obj_spamton_attack_mode_Draw_0

(view raw script w/o annotations or w/e)
1
if (state == 0 || state == 4)
2
{
3
    headtop.image_alpha = 0;
4
    draw_self();
5
}
6
else if (state == 1 || state == 3)
7
{
8
    headtop.image_alpha = 1;
9
    var ease = 
scr_ease_out
scr_ease_out

function
scr_ease_out(arg0, arg1)
{ if (arg1 < -3 || arg1 > 7) return arg0; switch (arg1) { case -3: return ease_out_bounce(arg0, 0, 1, 1); case -2: return ease_out_elastic(arg0, 0, 1, 1); case -1: return ease_out_back(arg0, 0, 1, 1); case 0: return arg0; case 1: return sin(arg0 * 1.5707963267948966); case 2: return -arg0 * (arg0 - 2); case 6: return -power(2, -10 * arg0) + 1; case 7: arg0--; return sqrt(1 - (arg0 * arg0)); default: arg0--; if (arg1 == 4) { return -1 * (power(arg0, arg1) - 1); break; } return power(arg0, arg1) + 1; } }
(timer / 10, 1);
10
    draw_sprite_ext(spr_spamton_laugh_bottom, 0, x, y, 2, 2, 0, c_white, 1);
11
    draw_sprite_ext(spr_spamton_laugh_middle, 0, x, lerp(y - 10, y, ease), 2, 2, 0, c_white, 1);
12
    headtop.y = lerp(y + 20, y - 4, ease);
13
}
14
else
15
{
16
    draw_sprite_ext(spr_spamton_laugh_bottom, 0, x, y, 2, 2, 0, c_white, 1);
17
    draw_sprite_ext(spr_spamton_laugh_middle, 0, x, (y + (cos(timer) * 4)) - 10, 2, 2, 0, c_white, 1);
18
    headtop.y = y - (cos(timer) * 4);
19
}