public void Run()
        {
            Console.Clear();
            var stopwatch = new Stopwatch();

            stopwatch.Start();
            Show(0);
            ConsoleUtilities.HideCursor();
            Offset  = 0;
            Running = true;
            while (Running)
            {
                if (stopwatch.ElapsedMilliseconds < 50)
                {
                    continue;
                }

                HandleInput();
                if (Refresh)
                {
                    Show(Offset);
                    Refresh = false;
                }
                stopwatch.Restart();
            }
        }
Esempio n. 2
0
 private void GameOver()
 {
     Console.WriteLine($"\n\nGAME OVER\n\tYOU'VE SCORED: {Score} POINTS!!");
     ConsoleUtilities.ShowCursor();
     Console.WriteLine("Please enter your name: ");
     ConsoleUtilities.HideCursor();
     _scoreWriter.SaveScore(Console.ReadLine(), Score);
     Console.WriteLine("RETRY? (y\\n)");
     GameOverInputLoop();
 }
Esempio n. 3
0
 public void Play()
 {
     Console.Clear();
     ConsoleUtilities.HideCursor();
     SeedQueue();
     NextBrick();
     Show();
     Alive = true;
     GameLoop();
     GameOver();
 }