Package playground

Class BreakoutLevelBaseAdvanced


public abstract class BreakoutLevelBaseAdvanced extends BreakoutLevelBase
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()
  • Constructor Details

    • BreakoutLevelBaseAdvanced

      public BreakoutLevelBaseAdvanced()
  • Method Details

    • prepareLevel

      public void prepareLevel(String level)
      Prepares a complete Breakout type level and uses the values provided by implementations of calcNrBricksX() and calcNrBricksY() to generate the stone matrix. Furthermore, it relies on the methods BreakoutLevelBase.createEgoObject(), BreakoutLevelBase.createBall() and BreakoutLevelBase.createBrick(int, int), which are meant to be overwritten in subclasses.
      Attention: For collision detection bricks created by BreakoutLevelBase.createBrick(int, int) need to have the String 'brick' in ID.
      Specified by:
      prepareLevel in class BreakoutLevelBase
      Parameters:
      level - String passes by the game engine (not used currently and can be ignored).
      See Also:
      • for further information.