How Do You Make Health Bar Above Player/enemy?
#1
Posted 26 December 2008 - 09:36 PM
Thanks Ill give credit if you can help
#2
Posted 26 December 2008 - 09:41 PM
In the draw event of the ememy and of the player place the following code
draw_healthbar(x,y-20,x+100,y-10,Inset health varible here,c_black,c_red,c_green,0,true,true) draw_sprite(sprite_index,-1,x,y)
There you go. You might want to adjust the positions of it
Ask if u need anymore help.
#3
Posted 26 December 2008 - 09:57 PM

^sorry, couldn't resist
EDIT:
Hi I know how to make a healthbar but..
oh,well, I guess you already knew...
Edited by Old School Gaming, 26 December 2008 - 10:06 PM.
#4
Posted 11 June 2009 - 09:39 AM
(i have lite)
#5
Posted 11 June 2009 - 10:10 AM
Alright add the draw health bar drag&drop in to he draw event.i haven't learned GML yet... can any one help on making a health bar and making it hover above me?
(i have lite)
put this in.
x1 = x+5
y1 = y+5
x2 = x+100
y2 = y-5
back color = black
bar color = green to red
This should make a nice health bar on lite
#6
Posted 16 December 2010 - 12:08 PM
draw_sprite(sprite_index,-1,x,y)
i made this but when my hero hit enemy its healthbar is not going low
#7
Posted 19 March 2011 - 12:43 AM
it is easy to fixdraw_healthbar(x,y-20,x+100,y-10,Inset health varible here,c_black,c_red,c_green,0,true,true)
draw_sprite(sprite_index,-1,x,y)
i made this but when my hero hit enemy its healthbar is not going low
MAke a collision event on enemy then set your health variable to -1 and click relative
#8
Posted 19 March 2011 - 04:43 AM
There are several ways of doing this, but I just listed one way
#9
Posted 01 April 2013 - 08:41 PM
it is easy to fixdraw_healthbar(x,y-20,x+100,y-10,Inset health varible here,c_black,c_red,c_green,0,true,true)
draw_sprite(sprite_index,-1,x,y)
i made this but when my hero hit enemy its healthbar is not going low
MAke a collision event on enemy then set your health variable to -1 and click relative
Doesn't seem to work for me.
#10
Posted 15 May 2013 - 10:34 PM
If this conversation is still active, I would like to report a problem I had with the moving health bar.
I put the event Draw in, and the draw health bar
x1:0
y1:0
x2:30
y2:-5
back colour: black
bar colour: green to red
set relative on
Now, whenever I play my game, my sprite_player turns invisible.
Is there any way to solve this?
Edited by Lemonpuss, 15 May 2013 - 10:34 PM.
#11
Posted 15 May 2013 - 10:44 PM
If this conversation is still active, I would like to report a problem I had with the moving health bar.
I put the event Draw in, and the draw health bar
x1:0
y1:0
x2:30
y2:-5
back colour: black
bar colour: green to red
set relative on
Now, whenever I play my game, my sprite_player turns invisible.
Is there any way to solve this?
Put draw_self() At the top of the draw event. This is because when the draw event is used, nothing is drawn (Not even the object's own sprite).
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users











