Multi-Resolution Game Development With GameBuilder Studio Check it out!
NEW Version 0.9.7 has arrived! New Blazing Fast Particle Engine & More Game Actions. Check it out
How to make an Health bar?
  • Hello, is there any way to make a system of a life bar depending on a value of a variable?
    Thanks!
  • 2 Comments sorted by
  • Ok, don´t need to say nothing... It´s simples, I am an idiot! 
    It´s just create an global with a name HP, then pick up a sprite and put it one Rules Map with a Timer: every 0 seconds do: Change propriety: @spatial.x = HP, and if the bar it´s to small, it´s just do @spatial.x = HP*2.
    Right?
  • @Sonic well when you say a health bar I'm thinking of a horizontal sprite that corresponds to a value between 0 and 100% of an objects' health. So you could start the health out at 100 and every time the object takes damage that value gets reduced by a certain amount. Then just divide the new health value by the original max amount and you have the percentage of the new health as a decimal. Just multiply the scale or width of your horizontal bar by that value.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

Tagged