slicky-grease
Member
I been working on an health-bar system for my enemy and I got everything working. The issues I have is that the health(the red) of the enemy isn't in the right position on where it should and it dosent fill the healthbar correctly and the health bar isn't following the enemy when he takes damage.
GML:
var grunt_health = (hp/max_hp) * 100
bar_x = 700
bar_y = 500
c = c_red
width = sprite_get_width(spr_enemyheathbar)
height = sprite_get_height(spr_enemyheathbar)
if alarm[1] > 0
{
draw_rectangle_color(bar_x, bar_y - height, bar_x + (width * grunt_health), bar_y + (height), c, c, c, c, false);
draw_sprite(spr_enemyheathbar, 0, bar_x, bar_y);
}