예제 #1
0
        public void Run()
        {
            int swarmMoveCounter     = 0;
            int playerMissileCounter = 0;

            do
            {
                sceneRender.Render(scene);
                Thread.Sleep(gameSettings.GameSpeed);
                sceneRender.ClearScreen();

                if (swarmMoveCounter == gameSettings.SwarmSpeed)
                {
                    CalculateSwarmMove();
                    swarmMoveCounter = 0;
                }
                swarmMoveCounter++;

                if (playerMissileCounter == gameSettings.PlayerMissileSpeed)
                {
                    CalculateMissileMove();
                    playerMissileCounter = 0;
                }
                playerMissileCounter++;
            } while (isNotOver);

            Console.ForegroundColor = ConsoleColor.Red;
            sceneRender.RenderGameOver();
        }
예제 #2
0
        public void Run()
        {
            int alienMoveCounter    = 0;
            int playerRocketCounter = 0;

            do
            {
                _sceneRender.Render(_scene);

                Thread.Sleep(_gameSettings.GameSpeed);

                _sceneRender.EmptyScreen();



                if (alienMoveCounter == _gameSettings.AlienSpeed)
                {
                    CalculateAlienMove();
                    alienMoveCounter = 0;
                }
                alienMoveCounter++;

                if (playerRocketCounter == _gameSettings.PlayerRocketSPeed)
                {
                    CalculateMissileMove();
                    playerRocketCounter = 0;
                }
                playerRocketCounter++;
            } while (_isNotOver);
            Console.ForegroundColor = ConsoleColor.Red;
            _sceneRender.RenderGameOver();
        }