How to make a Decreasing progress bar?

Hey community, I want to implement a decreasing progress bar as a way to represent an enemy’s health. From the looks of it, I can only make the progress bar increase, as the name itself clearly suggests. But aside from that, I feel as if there’s a possibility of doing this by using the “expression” logic. However, that’s a problem within itself because I can’t necessarily extend that value to expression “A”.

However, even by attempting so, my results yield a completely drained progress bar. I’ve tried extending the Bar output of 30 (max value) to expression A, which is also 30. B is -1, as an attempt to deduct an integer. Evaluation is based on collision of the enemy with the player. Again, as the name suggests, the progress bar only seems to be able to progress, not backtrack. Of course, I thought of making the progress bar increase as the enemy takes damage, but a health bar that merely increases proves to be extremely awkward. A solution is beyond me.

Thanks to any help, it is greatly appreciated.

Yeah, totally ignore me people…that’s cool.

Muphins, there are lots of examples of decreasing progress bars you can peek at.

Generally, though, you can try this:

Make a “Number” behavior, and set it to your health value. Add another number for damage, and set it to a negative number. Send the negative number into the add(+) input of your health, adding a negative number will decrease it. Send the output of your health number into the progress bar input.

Here is a complete example, along with some other logic to restart the game when you run out:

http://flowlab.io/game/play/9822

Muphins - also remember there is a search box at the top of the forum. Health bars are a good example of something you can find lots of discussion about and save yourself some time.

Sorry grazer. I end up searching for something and it yields no results. Maybe I’m not using the correct key words. Maybe an advanced search wouldn’t hurt? I understand this website is only in the beta stages, not trying to rush anyone. Thanks though

I was going to help you this afternoon, but my dad took me out for job searching all damn day. Trust me, nobody ignores you, we just don’t check the forum everyday.
My favorite way to do it is just an expression A-1.

Last job didn’t pan out? Sorry to hear that :confused:

Oh it’s alright. The business added 2 new buildings that took almost all our business. I went from 20 hours a week to 3 hours, on a Saturday. Most of the managers have quit or are quitting.