This site requires JavaScript, please enable it in your browser!
Greenfoot back

Report as inappropriate.

danpost
danpost presents ...

2012/2/5

Progress bar/Health bar class

Bar class with no editing required. All needed methods are available to suit most needs.

Download, and while NOT running, right click on the bar and experiment with some (or all) of the methods provided.

Also, check out some sub-classes you can use with the bar (to allow it to be adjustable; to make a switch; or to make a timer display) located in the following scenario:

http://www.greenfoot.org/scenarios/5677

16994 views / 43 in the last 7 days

24 votes | 0 in the last 7 days

Tags: demo with-source bar danpost progress-bar support-class health-bar

This scenario is a member of: Support Classes by danpost


open in greenfoot
Your browser does not support the canvas tag.
SullyFishSullyFish

2014/5/14

how would I make the bar go down by making a different class touch a different class?
SullyFishSullyFish

2014/5/14

it doesnt find bar.subtract in my other class
SullyFishSullyFish

2014/5/14

public void hit(){ Actor actor = getOneObjectAtOffset(0, 0, Ennemies.class); if(actor != null) { Bar.subtract(1); } }
danpostdanpost

2014/5/14

@SullyFish, start a discussion thread, show how you create the bar and how you are trying to use the bar (code posting is better in discussion threads).
SullyFishSullyFish

2014/5/14

nvm sorry I found it
A new version of this scenario was uploaded on 2017-01-20 23:18:50 UTC
A new version of this scenario was uploaded on 2017-10-16 02:02:20 UTC
Nate2002Nate2002

2018/11/29

This is pretty cool
data17data17

2019/1/9

public Bar useFul = new Bar("danpost", "thank you!", 100, 100); // easy peasy :-)
AbwattsAbwatts

2019/4/1

Thanks! Super easy and simple to use! Respect =]

See all comments

Want to leave a comment? You must first log in.

Who likes this?

data17 tjoepapke JerHowden Ariadia hugtvy SPower arinb kikumaru818 ndrwdslv FlyingRabidUnicornPig dianefayeparajes Poli solokeh rhddpcks Cocky davemib123 erdelf limefortheworld SkyLark tylers