예제 #1
0
        public static void Run()
        {
            while (true)
            {
                ConsoleGraphics graphics = new ConsoleGraphics();
                GameEngine      engine   = new ArkanoidGameEngine(graphics);
                engine.Start();

                graphics.DrawString("FOR NEW GAME PRESS SPASE\n  FOR EXIT GAME PRESS ESC", "Arial", 0xFF000080, 460, 450, 20);
                graphics.DrawString("(FOR RESET BEST SCORS  PRESS (R)", "Arial", 0xFF000080, 530, 550, 10);
                graphics.FlipPages();

                while (Console.KeyAvailable)
                {
                    Console.ReadKey();
                }
                ConsoleKeyInfo keyInfo = Console.ReadKey();
                ConsoleKey     key     = keyInfo.Key;

                if (key == ConsoleKey.Escape)
                {
                    break;
                }

                if (key == ConsoleKey.R)
                {
                    Scors.WriteInFileBestScors(0);
                    Scors.SetBestScors(0);
                }
            }
        }
예제 #2
0
        public Ball(ConsoleGraphics graphics, string img, ArkanoidGameEngine gameEngine) : base(graphics, img)
        {
            isBallStandingOnBoard = true;

            X  = 649;
            Y  = 730;
            H  = 16;
            W  = 16;
            Vx = rnd.Next(-14, 14);
            Vy = -14;
            this.gameEngine      = gameEngine;
            BallCrushedBlocksCnt = 0;
        }