A Bar object is pretty much like a Counter object in that it has a numeric value and displays it on the screen. The difference between the two is how the value is displayed. The basic content of this kind of class is:
- a field to hold the value
- a method to create the bar image (call it 'updateImage')
called from the constructor and any method that changes the bar value
- a method to return the value (call it 'getValue')
- one or more methods to adjust the bar value (ex. 'add', 'subtract', 'setValue', 'increment', 'decrement')
An example of a draft of a simple 'updateImage' method can be found at the following location:
http://www.greenfoot.org/topics/find/16886#post_16886
I realize you said "Sorry about bad language of game, I'll change it. " However, if you know it is inappropriate, you should not have put it up to begin with. I am asking that you remove this as soon as possible until you have corrected it.
@Spilli, I feel that if I allowed mouse control, the game would be too easy. I migh consider slowing the game down just a touch more; but I do not want it to become boringly slow.
@Poli, I put a little more distance between the bumpers and the paddle to allow for a little more reaction time; plus, I increased the speed of paddle movement.
2013/2/18
Progress bar/Health bar class
2013/2/11
castle defence 1
2013/2/8
Bomberman Mini
2013/2/7
Bomberman
2013/2/7
F* Missiles Chasing Me - With Math
2013/2/6
Pong Pinball
2013/2/6
Pong Pinball
2013/2/6
Pong Pinball
2013/2/6
Kara Sokoban