© 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 
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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.