Package playground
Class BreakoutLevelBaseAdvanced
java.lang.Object
playground.Playground
playground.BreakoutLevelBase
playground.BreakoutLevelBaseAdvanced
Advanced version of abstract
BreakoutLevelBase
providing a complete implementation of
prepareLevel(String)
. Additionally abstract methods for number of bricks in X and Y
direction are provided as well as abstract methods for brick sizes and start coordinates.- See Also:
-
calcNrBricksX()
calcNrBricksY()
getBrickSizeX()
getBrickSizeY()
getBrickStartX()
getBrickStartY()
-
Field Summary
Fields inherited from class playground.Playground
FLAGS_ALL, FLAGS_GLOBAL, FLAGS_LEVEL
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
prepareLevel
(String level) Prepares a complete Breakout type level and uses the values provided by implementations ofcalcNrBricksX()
andcalcNrBricksY()
to generate the stone matrix.Methods inherited from class playground.BreakoutLevelBase
applyGameLogic, gameOver, levelFinished, preferredSizeX, preferredSizeY, redrawLevel, resetRequested
Methods inherited from class playground.Playground
addObject, addObjectNow, collectObjects, deleteObject, deleteObjectNow, getGameTime, getGlobalFlag, getKeyEvents, getLevelFlag, getMouseEvents, getObject, getOrCreateGlobalFlag, getOrCreateLevelFlag, getSizeX, getSizeY, getTimestep, isPaused, processKeyEvents, processMouseEvents, redraw, reset, resetFlags, setGameTime, setGlobalFlag, setLevelFlag, setPaused, setTimestep, togglePause, updateObjects
-
Constructor Details
-
BreakoutLevelBaseAdvanced
public BreakoutLevelBaseAdvanced()
-
-
Method Details
-
prepareLevel
Prepares a complete Breakout type level and uses the values provided by implementations ofcalcNrBricksX()
andcalcNrBricksY()
to generate the stone matrix. Furthermore, it relies on the methodsBreakoutLevelBase.createEgoObject()
,BreakoutLevelBase.createBall()
andBreakoutLevelBase.createBrick(int, int)
, which are meant to be overwritten in subclasses.
Attention: For collision detection bricks created byBreakoutLevelBase.createBrick(int, int)
need to have the String 'brick' in ID.- Specified by:
prepareLevel
in classBreakoutLevelBase
- Parameters:
level
- String passes by the game engine (not used currently and can be ignored).- See Also:
-
for further information.
-