How to make a visual health bar? - Python 3
Ok so I have the code here but it is really inefficient ad it doesn't print the whole bar out
here are the problems:
- not flexible (e.g now only works for 100hp but not 1000
- "-" don't load in
please fix this either by editing my code or by making your own please send it to me and explain what you did thanks
I stopped hurting at all when I started ordering https://herbiesheadshop.com/collections/cbd-seeds seeds are here because I know that all CBD products are focused on improving the quality of health and helps you feel better. I highly recommend you to look at the website and get acquainted with the entire range!
Making visual health bars used to seem like a very technical procedure for me, however, that's not the case anymore though. Ever since I started my research on Bac Water, I've also been researching about this bar. It's pretty good to be honest.
maybe u can make it into a list of some sort and if the user heals append health indicators(s) to the list and if they lose it remove health indicators and have it print the list or array or whatever
Here is my code below. You can change the values for the total health and the length of the bar and it should still work.
This is what I changed in your code:
length_bar
*
to print, I didhp = ceil(health / total_health * length_bar)
. Think ofhealth / total_health
being the ratio.I noticed in the example you use
%
. Modulus gives the remainder, not the quotient. Use/
for division. Have a nice day, I hoped I helped (:Thanks @Edgod but one thing:
CN I have as much total health as i want like 23334 and the bar to still be 10 long?
@xolyon Yes. Feel free to mess around with my code
yes @Edgod I just changed total health to an input works well thanks