Tyrant is a 2D Top-Down and Tower Defense Rogue-Like, it uses Unity2D and C#, I did part of the gameplay system and game AI. Since the game level is organized in many rooms, I have created a room system for managing the level layout and tracking the player.
To track the player and control enemy spawning, each room has triggers that detect if the player has entered the room. These triggers can only be activated once to make sure we don’t repeatedly spawn enemies in areas that the player has visited. When a trigger is activated, the room number is passed to the spawn manager, which determines the type of enemy and spawns points to use. Triggers are also used to control which doors to unlock to open up new areas.
I created a spawn manager for spawn enemies and read spawn points data. I create waves with scriptable objects for spawn point configuration. Each spawn point’s data include room number, wave, and spawn range. Spawn manager will know how many waves and how many enemies need to spawn for each spawn point, and which room needs to spawn enemies.
I created a polymorphic enemy base class which all the enemy types derive for custom behaviors. There are four types of enemies in this game, including Charger, Boomer, Boomeranger, and mage. Each enemy is controlled by a finite state machine. However, depending on the enemy type, they have different state logic. For example, when attacking, the A will do blah, whereas, for B, it will do blah blah. I have also created a custom pathfinder using my own A* implementation.