Esempio n. 1
0
 static public bool OnCollisionFruits()
 {
     if (FruitPointManager.CheckedList(HeadElement().X, HeadElement().Y))
     {
         return(true);
     }
     return(false);
 }
Esempio n. 2
0
 static public void EatingFruit()
 {
     FruitPointManager.CheckedList(HeadElement().X, HeadElement().Y, out FruitPoint fruitPoint, out int i);
     if (fruitPoint != null)
     {
         FruitPointManager.DeleteElement(i);
         FruitPointManager.GenerateFruits();
         FruitPointManager.ShowSceneFruit();
         AddSnakeElement();
         Game.UpdateTime -= 10;
         Game.numFruitsEat++;
     }
 }
Esempio n. 3
0
 static public void StartGame()
 {
     WallPointsManager.BuildSceneWalls(0, 0, 79, 79);
     SnakePointsManager.StartGame(10, 40);
     WallPointsManager.ShowSceneWalls();
     Console.ForegroundColor = ConsoleColor.Red;
     ShowLabel("Нажмите \"Escape\" чтобы начать игру", 20, 20);
     ShowLabel("Чтобы поставить игру на паузу нажмите \"Escape\"", 20, 21);
     ShowLabel("Чтобы убрать паузу нажмите \"Escape\"", 20, 22);
     ShowLabel("Чтобы принудительно закончить игру нажмите \"Space\"", 20, 23);
     Console.SetWindowSize(79, 79);
     Console.SetWindowPosition(0, 0);
     Console.SetBufferSize(79, 79);
     while (Console.ReadKey(true).Key != ConsoleKey.Escape)
     {
     }
     pause = !pause;
     ShowLabel("                                                        ", 20, 20);
     ShowLabel("                                                        ", 20, 21);
     ShowLabel("                                                        ", 20, 22);
     ShowLabel("                                                        ", 20, 23);
     FruitPointManager.GenerateFruits();
     FruitPointManager.ShowSceneFruit();
 }
Esempio n. 4
0
 public FruitPoint(int x, int y)
 {
     X = x;
     Y = y;
     FruitPointManager.AddInList(this);
 }