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

28. Enemies, Towers, and Projectiles

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

In this chapter, we’ll create our first tower, the arrow tower, and set up the groundwork for towers firing projectiles at enemies. To accommodate this, we’ll also set up the base for our enemies, giving them health points and making them “die” when their health runs out. They won’t move yet, but they’ll give our towers something to shoot at.

These features will give us plenty of practice with the concept of inheritance. We’ll learn how to share the common functionality of an upper type, like a generic enemy, with the more specific implementation of lower types, ...

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.