I need help with a healthbar. The healthbar shows up but is not active. It will not update it self. Here is what I have been using: and gethealth() is just
public class DHealthbar extends Dragonoir { /** * Act - do whatever the DHealthbar wants to do. This method is called whenever * the 'Act' or 'Run' button gets pressed in the environment. */ public void act() { healthcheck(); } private void healthcheck() { if (gethealth() == 1000) {setImage("1000.png");} else if (gethealth() == 950) {setImage("950.png"); } else if (gethealth() == 900) {setImage("900.png "); } else if (gethealth() == 850) {setImage("850.png "); } else if (gethealth() == 800) {setImage("850.png "); } else if (gethealth() == 750) {setImage("750.png"); } else if (gethealth() == 700) {setImage("700.png "); } else if (gethealth() == 650) {setImage("650.png "); } else if (gethealth() == 600) {setImage("600.png "); } else if (gethealth() == 550) {setImage("550.png "); } else if (gethealth()== 500) {setImage("500.png "); } else if (gethealth() == 450) {setImage("450.png "); } else if (gethealth() == 400) {setImage("400.png "); } else if (gethealth() == 350) {setImage("350.png "); } else if (gethealth() == 300) {setImage("300.png "); } else if (gethealth() == 250) {setImage("250.png "); } else if (gethealth() == 200) {setImage("200.png "); } else if (gethealth() == 150) {setImage("150.png "); } else if (gethealth() == 100) {setImage("100.png "); } else if (gethealth() == 50) {setImage("50.png ") ; } else {setImage("0.png") ; } } }
return Healthpoints;