Пример #1
0
        /// <summary>
        /// Get the current renderer to draw the game
        /// </summary>
        public void Draw()
        {
            GuiEnvironment.GetRenderer().RenderWindow();

            MetaHandler.ShowPanels(); // IA - Make the panel visible

            // IA - Single Player Mode only.
            if (_gameStates.Peek() == GameState.SinglePlayerMode)
            {
                MetaHandler.DisplayHungerInformation();                             // IA - Show the hunger level progress bar and messages
                MetaHandler.DisplayTimer();                                         // IA - Make the timer visible
                MetaHandler.DisplayGameLevel();                                     // IA - Display the game level
                MetaHandler.DisplayAmmunitionLevel(_player.Weapon);                 // IA - Display info about amminutions (type and amount)
                MetaHandler.DisplayEnemiesInfo(SpawnedEnemies, EnemiesToBeRemoved); // IA - Display how many enemies have been destroyed.
                MetaHandler.DrawFoodField(GetPlayer().Inventory);
            }

            // IA - Only display the worth of minerals while the game runs.
            if (_gameStates.Peek() == GameState.SinglePlayerMode)
            {
                MetaHandler.DisplayRate(GetPlayer().Inventory.GetTotalValue(), GetPlayer().Inventory);
            }

            // IA - Two Players Mode only.
            if (_gameStates.Peek() == GameState.TwoPlayerMode)
            {
                MetaHandler.DisplayTwoPlayersInstructions();
                MetaHandler.DisplaySinglePlayerWeaponInfo(_player, "Player 1", 15);
                MetaHandler.DisplaySinglePlayerWeaponInfo(_player2, "Player 2", 85);
                MetaHandler.DisplayRate(_player.Inventory.GetTotalValue(), _player.Inventory, "PLAYER 1", -190, Color.Wheat);
                MetaHandler.DisplayRate(_player2.Inventory.GetTotalValue(), _player2.Inventory, "PLAYER 2", 10, Color.Yellow);
            }
        }