frame

Howdy, Stranger!

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

Sign In Register

How To Create Health (Plus Bar)

edited July 2013 in General
Read reply by Grazer For info. This fourm Is for my brother :3

How Do i create health? i did try to look in the logic of "Epic Adventure" But i di not get it

Comments

  • I made an example to show one approach to creating player health, with a health bar:

    Health Example

    The health value is just a Number behavior, which I named "Health" and set to an initial value of "10". The output of this number goes into a Bar ui behavior, and I added a Once trigger to ensure that the bar always gets reset.

    To add some damage, I added a Collision trigger, thats increments the Health number by "-2" every time they touch. As a finishing touch, I am also filtering the output of the Health, so that if it drops below "1", then the game will restart.

    Let me know if you have any questions or comments.
  • i found a glitch in your example!

    when the game restarts there are 2 people.
  • Thanks for the heads up - that glitch is fixed :)
Sign In or Register to comment.

flowlab.io

| make games in your browser
@ 2017 Flowlab.io, All rights reserved.

Contact us

Get In Touch