private void GameStart() { // fillingPattern = new BasicPattern(); fillingPattern = new ZigZagPattern(); wallOfBricks = new Wall(4, PlaygroundWidth, fillingPattern); DrawPaddle(); wallOfBricks.DrawWall(); DrawBall(); Console.Write("\b \b"); while (true) { if (Console.KeyAvailable) { ConsoleKeyInfo pressedKey = Console.ReadKey(); ChangePaddlePosition(pressedKey); } DrawPaddle(); this.ChangeBallPosition(); DrawBall(); wallOfBricks.UpdateWall(previousBallPositionX, previousBallPositionY); Thread.Sleep(gameSpeed); } }
public Wall(int height, int width, IFillingPattern pattern) { this.Height = height; this.Width = width; this.FilledWall = new IBrick[height, width]; this.FillingPattern = pattern; }