Пример #1
0
 public void Start()
 {
     if (running)
     {
         return;
     }
     running       = true;
     console       = GameConsole.Instance;
     console.Title = title;
     inputHandler  = InputHandler.Instance;
     timer         = new Stopwatch();
     random        = new Random();
     board         = new Board(console.Width, console.Height);
     snake         = new Snake();
     apple         = new Apple();
     PlaceApple();
     timer.Start();
     Run();
 }
Пример #2
0
 public GameObject(int boardWidth, int boardHeight)
 {
     snake = new Snake();
     apple = new Apple(boardWidth, boardHeight);
     apple.PrintFirstApple(snake);
 }