Advertisement

Weapons

  • Alan Thorn
Chapter

Abstract

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 haven’t created any enemies for CMOD—they’ll be coded in the next chapter. But here we’ll at least make a start with weapons. In creating these, a wide range of Unity and C# concepts will be explored in depth; specifically, sprite and object animation, physics and rays, object orientation, class inheritance and polymorphism. So let’s get started…

Keywords

Base Class Object Orientation Scene Geometry Player Object Script File 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

Copyright information

© Alan Thorn 2014

Authors and Affiliations

  • Alan Thorn
    • 1
  1. 1.EssexUnited Kingdom

Personalised recommendations