With our Build Mode giving the player a means of buying and selling towers, we can now begin to work on Play Mode. During Play Mode, enemies spawn at the spawn point near the top of the stage and navigate around towers using pathfinding, traveling toward the leak point at the bottom of the stage.
In this chapter, we’ll implement pathfinding whenever the player buys or sells a tower, keeping an updated path from spawn point to leak point. If the path is blocked, we’ll prevent the player from clicking the Play button until the path becomes unblocked (they’ll have to sell towers to clear ...