Exemplo n.º 1
0
	private void buildWall() {
		// sets bricks to the wall within a given height and width
		// the height depends on the current game level
		// the width depends on the actual width of the game field
		while(getBrickY() < wallHeight) {			
			while(getBrickX() < wallWidth) {
				// get a new brick and set parameters to the brick
				randomBrick = getRandomBrick();
				randomBrick.setXCoord(getBrickX());
				randomBrick.setYCoord(getBrickY());				
				randomBrick.setId(Integer.toString(getBrickX()) + Integer.toString(getBrickY()));
				brickList.add(randomBrick);
				setBrickX(getBrickX() + randomBrick.getWidth() + 10);
			}
			setBrickY(getBrickY() + randomBrick.getHeight() + 10);
			setBrickX(BreakWallModel.randomFromRange(1, 3) * 15);
		}
	}