Exemple #1
0
        public override void Draw(Microsoft.Xna.Framework.Graphics.SpriteBatch a_spriteBatch)
        {
            if (m_isPaused)
            {
                m_gameView.DrawPauseMenu(a_spriteBatch, m_camera);
            }
            else if (m_levelComplete)
            {
                if (m_currentLevel == CurrentLevel.END)
                {
                    m_gameView.RenderGameWonScreen(a_spriteBatch, m_camera);
                }
                else
                {
                    m_gameView.RenderLevelCompleteScreen(a_spriteBatch, m_camera);
                }
            }
            else if (m_gameModel.IsPlayerDead() && m_deathAnimationTimer > m_deathAnimationEnd)
            {
                m_gameView.RenderDeathScreen(a_spriteBatch, m_camera);
            }
            else
            {
                m_gameView.DrawLevel(m_level, m_gameModel.GetPlayerTextureSize(), a_spriteBatch, m_gameModel.GetPlayerPos(), m_camera);
            }

            if (m_particles != null)
            {
                m_particles.Draw(a_spriteBatch, m_camera);
            }

            base.Draw(a_spriteBatch);
        }
Exemple #2
0
        public void Draw(SpriteBatch spriteBatch, float seconds)
        {
            gameSeconds += seconds;

            if (gameSeconds > 3f)
            {
                InitiateParticleSystem();
                gameSeconds = 0;
            }
            splitterSystem.Update(seconds);
            spriteBatch.Begin();
            spriteBatch.Draw(level, camera.GetGameWindow(), Color.Black);
            splitterSystem.Draw(spriteBatch, camera, sprite);
            spriteBatch.End();
        }
Exemple #3
0
        /// <summary>
        /// This is called when the game should draw itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Draw(GameTime gameTime)
        {
            Rectangle titleSafeRectangle = GraphicsDevice.Viewport.TitleSafeArea;

            //Ritar ut bakgrundsbild och en ram omkring den innan jag ritar ut bollen
            ballView.DrawLevel(backgroundTexture, titleSafeRectangle, frame, Color.Black, pixel);
            // Här ritas bollen ut ovanpå bakgrunden
            ballView.DrawBall(ballSimulation);
            shockwave.Draw(spriteBatch, (float)gameTime.ElapsedGameTime.TotalSeconds);
            splitterSystem.Draw(spriteBatch, particleTexture);
            explosion.Draw(spriteBatch, (float)gameTime.ElapsedGameTime.TotalSeconds);


            base.Draw(gameTime);
        }