Once the room Camera System was working, I developed it further to add to the rogue-lite game genre.

The Room Manager gameobject that handled the camera in the previous PRG post, needed to have extra features implemented into it. These features include:
- Enemies spawn when and only when the player enters the room
- The player is locked in the room when they enter
- The Room Manager needs to keep track of how many enemies are in the room
- The player must be able to leave once the enemies are defeated
The reason these features are required is due to research done from existing 2D Roguelite Dungeon games such as: Cult of the Lamb, The Binding of Isaac, Moonlighter etc. This research is documented in this Research Post.
To add all of these features, I created a new C# script called RoomManager, which would call a method called ActivateObjects() whenever the player would enter the room, this method would activate a gameobject called objectsToActivate, this gameobject would be the parent object of all of the room’s doors and enemies. Locking the player in the room and activating the enemies when the player entered.
Once the enemies were activated, the script would keep track of all of the enemies using a List and the GameObject.FindGameObjectsWithTag function. Once the enemies died, they would call the RoomManager script’s EnemyKilled() method which would remove them from the list of enemies in the room. Once this list reached a count of 0, the doors locking the player in would be deactivated.
