This is for the programmers out there.
I'm trying to figure out how to write this loop.
If your Health is between 70% to 100%, you are strong.
If your Health is between 40% to 69%, you are weak.
If you Health is between 1% to 39%, you are dying.
What's the best way to write this?
More info : If say, your health's maximum value changes? Maybe at level 1, you have 100 health. But at level 2, you have 112 health. Right now I'm using hard numbers, but I'd prefer to be more like a programmer. :)
There are many ways to do this. I've included 2 ways in this capx. (One is toggled disabled. They both produce the same result, but there might be a use for each. The first is easiest to understand.
Variables are used for all of the health range limits, so if you want to change the health range levels you just change the values for the globals. In the comments I included your original numbers so that you can see more easily what is going on.
Oh I get it! Global variables and writing the values there! I was getting really close to that solution, but your method is was more organized and cleaner. Thanks! :)
Develop games in your browser. Powerful, performant & highly capable.
a bit simpler healthState.capx