Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_susiezilla_singlescreen_hud_hp_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 ratio = 1;
6
if (tracker != -4)
7
{
8
    with (tracker)
9
        ratio = hp / maxhp;
10
}
11
draw_sprite_ext(sprite_index, image_index, floor(x), floor(y + jumpoff), image_xscale, image_yscale, image_angle, image_blend, image_alpha);
12
var col = make_color_hsv(97.75 * ratio, 255 * (0.56 + (0.34 * (1 - ratio))), 219.29999999999998);
13
var bar_length = 65 * ratio;
14
draw_sprite_part_ext(spr_susiezilla_singlescreen_hpbar_bar, image_index, 8, 0, bar_length, 59, floor(x) - 26, floor((y - 118) + jumpoff), -image_xscale, image_yscale, col, image_alpha);