Hello everyone!
I'm almost done with my game and I need some help. Here's my question: how can I charge my player's ultimate in this specific way? The variable "bossHP" is equal to 350. I want that as the player deals damage, the ultimate bar goes up. I'd like to use a formula so that the closer the bossHP gets to zero, the more it rises. If my question is confusing, I apologize, English is not my native language.
Develop games in your browser. Powerful, performant & highly capable.
Isn't this just a simple subtraction?
Ultimate = 350 - bossHP
Or if you want to normalize it so Ultimate ranges from 0 to 100
Ultimate = 100 * (350 - bossHP) / 350
If you want the ultimate to rise exponentially according to the bossHP you could consider using a fraction of bossHP. like x/bossHP.
Here is a c3p if you want take a look at it. https://file.io/wanCf2zt1zJy
The function I used in the example looks like this in geogebra.
Im not sure if this is what you were aiming for but I hope it helps.
thank you! it helped me alot