示例#1
0
        public void Draw()
        {
            myGame.GraphicsDevice.Viewport = new Viewport(camX, 0, gameWidth, gameHeight);

            foreach (IBackground back in backgroundElements)
            {
                back.Draw();
            }
            foreach (IItem item in itemElements)
            {
                item.Draw();
            }
            foreach (IItem fireBall in fireBallList)
            {
                fireBall.Draw();
            }
            if (IsPaused)
            {
                pauseText.Draw();
            }
            if (mario.isVisible)
            {
                mario.MarioDraw();
            }
            foreach (IBlock block in envElements)
            {
                block.Draw();
            }
            foreach (IEnemy enemy in enemyElements)
            {
                if (enemy.position.X > (-myGame.GraphicsDevice.Viewport.X) - GameConstants.SquareWidth && enemy.position.X < ((-myGame.GraphicsDevice.Viewport.X) + GameConstants.ScreenWidth))
                {
                    enemy.Draw();
                }
            }
            scoreSystem.DisplayScore(mario.totalScore);
            scoreSystem.CoinSystem(mario.coin);
            scoreSystem.WorldSystem();
            scoreSystem.Time();
        }