Chapter     6

Weapons

Let’s quickly recap what we’ve done so far in CMOD. At this stage, we’ve created a complete game environment with rooms and corridors, collectable power-up objects for health restore and cash bonuses, a notifications manager class to send and dispatch events to game objects, and a universal player controller for desktops and mobiles, including first-person functionality with a complementary head bob. In this chapter, we’ll build on this existing work by adding weapons for the Player character—specifically, a short-range fists/punch weapon (the default weapon) and a long-range gun weapon, which can be collected through a weapons power-up. The purpose of these weapons is to damage Enemy characters. Of course, right now, we ...

Get Pro Unity Game Development with C# 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.