© Casey Hardman  2020
C. HardmanGame Programming with Unity and C#https://doi.org/10.1007/978-1-4842-5656-5_30

30. Play Mode

Casey Hardman1 
(1)
West Palm Beach, FL, USA
 

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 ...

Get Game Programming with Unity and C#: A Complete Beginner’s Guide 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.