Exemple #1
0
        /// <summary>
        /// Narysuj wszytskie elementy znajduj¹ce siê w aplikacji. W zaleznoœci od ustawionego okna wybierz odpowiedni
        /// Screen do rysowania
        /// </summary>
        /// <param name="gameTime">czas trwanie gry</param>
        protected override void Draw(GameTime gameTime)
        {
            IsMouseVisible = true;
            if (ScreenType != ScreenType.Login && _mainMenu == null)
            {
                LoadRestSreens();
            }
            GraphicsDevice.Clear(Color.White);
            _spriteBatch.Begin();
            _spriteBatch.Draw(_background, new Rectangle(0, 0, Window.ClientBounds.Width,
                                                         Window.ClientBounds.Height), Color.White);
            _spriteBatch.End();
            _planetEngine.Draw(_spriteBatch);
            if (Utils.User == null || Utils.User.IsAnimation)
            {
                _rocketeEngine.Draw(_spriteBatch);
            }
            switch (ScreenType)
            {
            case ScreenType.MainMenu:
                _mainMenu.Draw(_spriteBatch);
                break;

            case ScreenType.Settings:
                _settings.Draw(_spriteBatch);
                break;

            case ScreenType.Help:
                _help.Draw(_spriteBatch);
                break;

            case ScreenType.HighScores:
                _highScores.Draw(_spriteBatch);
                break;

            case ScreenType.Game:
                _game.Draw(_spriteBatch);
                break;

            case ScreenType.LoadGame:
                _loadGame.Draw(_spriteBatch);
                break;

            case ScreenType.Login:
                _login.Draw(_spriteBatch);
                break;
            }
            if (Utils.User == null || Utils.User.IsAnimation)
            {
                _starsEngine.Draw(_spriteBatch);
            }
            base.Draw(gameTime);
        }