Beispiel #1
0
        public void Draw(SpriteBatch spriteBatch, GameTime gameTime)
        {
            DrawBoard(spriteBatch);

            // Draw items
            for (int y = 0; y < TilesHigh; y++)
            {
                for (int x = 0; x < TilesWide; x++)
                {
                    if (_tileItems[x, y] != null)
                    {
                        _tileItems[x, y].Draw(spriteBatch, gameTime);
                    }
                }
            }

#if DEBUG
            if (!HideBlinky)
            {
                DrawGhostDirection(spriteBatch, Blinky);
            }
            if (!HidePinky)
            {
                DrawGhostDirection(spriteBatch, Pinky);
            }
            if (!HideInky)
            {
                DrawGhostDirection(spriteBatch, Inky);
            }
            if (!HideClyde)
            {
                DrawGhostDirection(spriteBatch, Clyde);
            }
#endif

            PacMan.Draw(spriteBatch, gameTime);

            if (!HideBlinky)
            {
                Blinky.Draw(spriteBatch, gameTime);
            }
            if (!HidePinky)
            {
                Pinky.Draw(spriteBatch, gameTime);
            }
            if (!HideInky)
            {
                Inky.Draw(spriteBatch, gameTime);
            }
            if (!HideClyde)
            {
                Clyde.Draw(spriteBatch, gameTime);
            }

            // Fruit
            if (Fruit != null)
            {
                Fruit.Draw(spriteBatch, gameTime);
            }

            // Effects
            for (int i = 0; i < Effects.Count; i++)
            {
                Effects[i].Draw(spriteBatch, gameTime);
            }

            // HUD
            DrawHud(spriteBatch);
        }