Logic for Forts

Forts are set up as small dense challenge areas that force the player to fight a set of enemies in order to either unlock progression on the map (opening the ice door on this map) or to unlock a fixed reward (coins or a permanent extra heart when encountered on the open world).

They are setup as the object GeneralFortBoundingBox and include the following parameters:

When the player enters the area of a fort, fort-specific combat music starts, the fixed number of enemies spawn, the spawn portals are created, and the siege bow rats are spawned.

Any open world enemies still alive are deleted and the door of the fort closes behind the player.

If the player teleports out of the fort, it destroys all enemies and ceases the fort specific combat music. Some logic should take place at this point to spawn enemies back out in the open world again.

If the player dies in the process of battling inside a fort, they should respawn at a point directly outside of the fort.

To win the fort, the player must close all the spawn portals and all the crossbow rats–as soon as they meet this criteria, all enemies are destroyed and some victory music should play.

In the future, some forts will feature specific mini-bosses and additional parameters will be added to specify different sets of enemies.

bearhammergame Avatar

Posted by

Leave a comment