Adding enemies to the Dungeon Board

There are a few things to consider when switching to the Dungeon Board and spawning new enemies. First, we need to determine what will happen when the enemies are off screen. On the world board, we simply destroyed the enemies. We can justify this action because new enemies will be generated as the player discovers new tiles on the world board. However, the player doesn't generate new tiles with movement in the dungeon.

For simplicity, we'll want to generate the dungeon enemies at the same time we generate the dungeon. This means that most enemies generated in a dungeon are generated off screen. If we kept the same offscreen check we had for the world board, we would end up generating enemies and then destroying ...

Get Procedural Content Generation for Unity Game Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.