Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_susiezilla_singlescreen_hud_score_Draw_0

(view raw script w/o annotations or w/e)
1
if (i_ex(obj_tenna_enemy))
2
    exit;
3
var jump = abs(x - xprevious) * 0.125;
4
var jumpoff = -abs(sin(timer * 0.5) * jump * 2) + 4;
5
var py1 = floor(image_index) * 4;
6
var py3 = -floor(image_index) * 4;
7
my_score = min(my_score, 999);
8
global.flag[1118 last_minigame_points] = my_score;
9
digits = string_length(string(my_score));
10
switch (digits)
11
{
12
    case 1:
13
        sprite_index = spr_susiezilla_hudguy_score1;
14
        break;
15
    case 2:
16
        sprite_index = spr_susiezilla_hudguy_score2;
17
        break;
18
    case 3:
19
        sprite_index = spr_susiezilla_hudguy_score3;
20
        break;
21
}
22
draw_set_font(fnt_comicsans);
23
draw_set_halign(fa_center);
24
draw_set_valign(fa_middle);
25
draw_sprite_ext(spr_susiezilla_shadowman_score_paper, image_index, x + 52, ((y - 82) + jumpoff) - py1, image_xscale, flip1_scale * 2, image_angle, image_blend, image_alpha);
26
if (!flip1)
27
    draw_text_transformed_color(x + 52 + 1, ((y - 82) + jumpoff) - py1, string_char_at(string(my_score), 1), 2, 2, 0, c_black, c_black, c_black, c_black, 1);
28
if (digits >= 3)
29
{
30
    draw_sprite_ext(spr_susiezilla_shadowman_score_paper, image_index, x + 50, ((y - 24) + jumpoff) - (py3 * 0.5), image_xscale, flip3_scale * 2, image_angle, image_blend, image_alpha);
31
    if (!flip3)
32
        draw_text_transformed_color(x + 50 + 1, ((y - 24) + jumpoff) - (py3 * 0.5), string_char_at(string(my_score), 3), 2, 2, 0, c_black, c_black, c_black, c_black, 1);
33
}
34
draw_sprite_ext(sprite_index, image_index, x, y + jumpoff, image_xscale, image_yscale, image_angle, image_blend, image_alpha);
35
if (digits >= 3)
36
    draw_sprite_ext(spr_susiezilla_hudguy_score_overlay3, image_index, x, y + jumpoff, image_xscale, image_yscale, image_angle, image_blend, image_alpha);
37
if (digits >= 2)
38
{
39
    draw_sprite_ext(spr_susiezilla_shadowman_score_paper, image_index, x + 44 + (py1 * 0.5), ((y - 50) + jumpoff) - py1, image_xscale, flip2_scale * 2, image_angle, image_blend, image_alpha);
40
    if (!flip2)
41
        draw_text_transformed_color(x + 44 + (py1 * 0.5) + 1, ((y - 50) + jumpoff) - py1, string_char_at(string(my_score), 2), 2, 2, 0, c_black, c_black, c_black, c_black, 1);
42
    draw_sprite_ext(spr_susiezilla_hudguy_score_overlay2, image_index, x, y + jumpoff, image_xscale, image_yscale, image_angle, image_blend, image_alpha);
43
}
44
draw_set_halign(fa_left);
45
draw_set_valign(fa_top);