The constructor for the bar takes two Strings and two ints.
- 1st string: name of bar (your choice; mine says Player 1)
- 2nd string: unit of measure for what the bar is used (mine says Health Points)
- 1st int: the initial value of the bar (mine starts at 25)
- 2nd int: the maximum value of the bar (initially set at 100)
I will check how well documented it is, and if not satisfactory, will update it.
That button was programatically disabled for that menu. There are methods in the Menu class that will 'activate' and 'deactivate' specified buttons within it. That was just an example of deactivating a menu button.
@sp33dy, I believe that is due to the difference between the actual size of the image and the size of the ball itself within the image.
@2Karl, since the balls are round, maybe you should use 'getObjectsInRange' for collision checking, instead of using one of the 'intersecting' methods.
Since each keypress is to produce one letter, you really should use the 'getKey' method instead of the 'isKeyDown' method, which can cause more than one character to be added to the string on a keypress.
Just to clarify: switch a bulb on or off by clicking on it, and all the bulbs next to it, horizontally and/or vertically, switch states (from on to off, or from off to on, depending on their starting state). It is part of the all-ones collection of games, so, yes, the object is to turn them all on.
Encountered a situation in the level with the row of invinsible bricks. If no breakable bricks remain in the general area above the unbreakables, the ball can bounce back and forth repeatedly in the same pattern and will not ever return to the bottom half of the screen. A random, but infrequent, small turn could fix this.
I just made my world equal in size to yours (800, 400, 1). I way overdid the number of tile objects needed; as before I could easily have gotten away with less then half of what I had. Still, my tile array, now, is 55x30, which is 1650 (about half of what I had).
I think the reason I had so many before, was that I did not want the pattern to repeat so quickly.
Anyway, there is very little, if noticable, lag.
My version created 3200 16x16 tiles objects, and move all of them on each movement. It then relocates any tile that are way off the screen to the opposite side; always keeping a full background in view. No image manipulating required.
2012/6/27
Progress bar/Health bar class
2012/6/25
Menu Demo
2012/6/25
Bouncing Balls
2012/6/24
password protect
2012/6/19
Light, Unlimited 點燈遊戲 無限版
2012/6/17
BreakOut
2012/6/13
PianoMemory
2012/6/12
Tile Pixel Scrolling
2012/6/12
Tile Pixel Scrolling