Exemple #1
0
 public Game(int aWidth, int aHeight)
 {
     _gameField = new GameField(aWidth, aHeight);
     _snake     = new Snake(aWidth / 2, aHeight / 2);
     _snake.SetField(_gameField);
     _fruit = new Fruit(_rand.Next(aWidth), _rand.Next(aHeight));
     _fruit.SetField(_gameField);
     _gameOver = false;
 }
 public SnakeGame(int aWidth, int aHeight) : base(aWidth, aHeight)
 {
     _score = 0;
     _gameField.FrameColor  = ConsoleColor.Red;
     _gameField.FrameSymbol = (char)9632;
     _gameField.DrawFrame();
     _snake = new Snake(aWidth / 2, aHeight / 2);
     _snake.SetField(_gameField);
     _fruit = new Fruit(_rand.Next(aWidth), _rand.Next(aHeight));
     _fruit.SetField(_gameField);
 }