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

2014/5/19

Oxygen Bar

docinkc docinkc

2014/5/19

#
Hi, I am making a game where the character is an Astronaut in space and I would like to have an Oxygen Bar similar to a health bar but will slowly go down unless an oxygen tank is picked up. Can someone create some code for this because I am lost.
danpost danpost

2014/5/19

#
A Bar is basically a Counter. A Counter changes its image to reflect a change in the value that it represents; a Bar is exactly the same. The only difference is what those changes in its images are. A Counter will always show a the current value in text form; a bar may also do this. But, the bar will update its image by adjusting the length of the bar itself; that is the only significant difference between the two. Although, in order to do this, it would need to know the maximum value allowed (and the minimum, if not assumed to be zero).
You need to login to post a reply.