Esempio n. 1
0
        public void UpdateObjects(Player player)
        {
            ToUpdate.Clear();

            Creatures.FilterDead();
            Items.FilterDead();

            ToUpdate.Where(o => !o.IsDead).ToList().ForEach(o => o.Update(player));
        }
Esempio n. 2
0
        // Called when a portal is triggered.
        public static void ChangeRoom(Room newRoom, Vector2 newPosition)
        {
            if (newRoom != CurrentRoom)
            {
                // Clear out the lists because they will be repopulated for the new room.
                ToUpdate.Clear();
                ToDraw.Clear();
                InputManager.RegisteredActors.Clear();

                CurrentRoom = newRoom;

                FocusObject.OnCreate(); // This is normally called in the constructor to add the object to lists.
            }
            FocusObject.Body.Position = newPosition;
        }