Ejemplo n.º 1
0
        public static void Draw(SpriteBatch spriteBatch, GameTime gameTime, bool IsHidingUI)
        {
            if (ScreenManager.Ingame || (ScreenManager.Paused && !ScreenManager.Editing))
            {
                if (ScreenManager.Paused)
                {
                    if (!IsHidingUI)
                    {
                        PauseMenu.Draw(spriteBatch);
                    }
                }
                Level.DrawBackground(spriteBatch);
                if (PPlayer.DeathCountdown != 0)
                {
                    PPlayer.Player.Draw(spriteBatch, gameTime);
                    SquareObject.DrawSquares(SquareObject.sqObjectArray, spriteBatch, 17, 16);

                    foreach (Entity entity in Entity.EntityList)
                    {
                        if (entity.Active)
                        {
                            entity.Draw(spriteBatch, gameTime);
                        }
                    }
                    if (MessageBox.GameMessage != null)
                    {
                        if (!IsHidingUI)
                        {
                            MessageBox.GameMessage.Draw(spriteBatch);
                        }
                    }
                    for (int w = 0; w < Checkpoint.checkpointList.Count; w++)
                    {
                        if (((Checkpoint.checkpointList[w] != null) && (Vector2.Distance(Checkpoint.checkpointList[w].collectable.Position + Level.Offset, new Vector2(400f, 300f)) < 550f)) && (Checkpoint.checkpointList[w].collectable != null))
                        {
                            if (PPlayer.CurrentCheckpoint == Checkpoint.checkpointList[w].ID)
                            {
                                Checkpoint.checkpointList[w].collectable.Draw(spriteBatch, Color.Red);
                            }
                            else
                            {
                                Checkpoint.checkpointList[w].collectable.Draw(spriteBatch);
                            }
                        }
                    }
                    foreach (Collectable Cobject in Collectable.collectableList)
                    {
                        if ((Cobject != null) && (Vector2.Distance(Cobject.Position + Level.Offset, new Vector2(400f, 300f)) < 550f))
                        {
                            Cobject.Draw(spriteBatch);
                        }
                    }
                    for (int i = 0; i < Level.ChaliceList.Count; i++)
                    {
                        Level.ChaliceList[i].Draw(spriteBatch);
                    }
                }
            }
        }
Ejemplo n.º 2
0
 public static void Draw(SpriteBatch spriteBatch, GameTime gameTime, bool IsHidingUI)
 {
     if (ScreenManager.Editing && !ScreenManager.Levelselect)
     {
         DrawBackGrounds(spriteBatch, IsHidingUI);
         if (PPlayer.DeathCountdown < 0)
         {
             SquareObject.DrawSquares(SquareObject.sqObjectArray, spriteBatch, 17, 16);
             DrawEntities(spriteBatch, gameTime);
             if (!IsHidingUI)
             {
                 DrawMisc(spriteBatch);
             }
             DrawCollectables(spriteBatch);
             if (!IsHidingUI)
             {
                 DrawAttachedItems(spriteBatch);
             }
         }
     }
 }