Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
-2
rated 0 times [  4] [ 6]  / answers: 1 / hits: 23987  / 11 Years ago, fri, november 29, 2013, 12:00:00

I am trying to make my own version of a pokemon game using very simple HTML and JavaScript.



So far, I have everything covered, except the health bar. How do I make an entity in my code, that will represent a bar, and when the opposing team selects a move, the health bar goes down?



Would I use a bunch of small div's?


More From » html

 Answers
6

I would recommend a HTML progress bar:



<progress id=health value=100 max=100></progress>


And when they lose/gain health, do run this Javascript code:



let health = document.getElementById(health)
health.value -= 10; //Or whatever you want to do with it.

[#74003] Wednesday, November 27, 2013, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
cartersinceren

Total Points: 442
Total Questions: 116
Total Answers: 106

Location: San Marino
Member since Thu, Jun 30, 2022
2 Years ago
cartersinceren questions
Thu, Nov 5, 20, 00:00, 4 Years ago
Thu, Apr 16, 20, 00:00, 4 Years ago
Fri, Feb 1, 19, 00:00, 5 Years ago
;