V
Valcia
Guest
this code is in my creation code of my player
< //HP
_hp = 10;
healthbar_width = 285;
healthbar_height = 48;
healthbar_x = 40;
healthbar_y = 0;
//100 pixels above the player />
so i created a draw event, then i made a script like this
if (_hp == 9 )
{
draw_sprite(spr_health_9,0,healthbar_x,healthbar_y)
}
but after using the draw event my player goes missing and the healthbar is not there too idk why.
Please be kind, im quite new to game maker
forgot to mention:
if the player touches the enemy, his hp -= 1;
< //HP
_hp = 10;
healthbar_width = 285;
healthbar_height = 48;
healthbar_x = 40;
healthbar_y = 0;
//100 pixels above the player />
so i created a draw event, then i made a script like this
if (_hp == 9 )
{
draw_sprite(spr_health_9,0,healthbar_x,healthbar_y)
}
but after using the draw event my player goes missing and the healthbar is not there too idk why.
Please be kind, im quite new to game maker
forgot to mention:
if the player touches the enemy, his hp -= 1;