Game Development Reference
In-Depth Information
Chapter 10
Refinements and Improvements
Splendid! You've reached the final chapter of the topic. CMOD is now complete and feature-filled.
True, it's a relatively short game with just one level, two weapons, and three enemy types. And many
gamers might even mistake the game for being “simple.” But we know now that this is really more of
a simplification than anything else. Despite being small, CMOD makes use of an extensive range of
Unity features and C# nuances, and these in turn depend on concepts and theory that's far
from obvious.
In Chapter 2, we constructed a level using the modular building technique, added lightmapping for
static lighting, and configured enemies and power-up objects using Prefabs. In Chapter 3, we laid
the foundations for CMOD in terms of scripting and class design by creating a NotificationsManager
to support an event-driven paradigm, allowing objects to post game events when they happen, and
for registered listeners to be automatically notified of the events. This class came in handy for all
subsequent chapters.
In Chapter 4, we moved forward to create collectible power-up objects in the level, such as health
restore, ammo restore, new weapons, and cash. In doing this, we saw the singleton design pattern,
and implemented camera-aligned billboards for sprite objects. In addition, we created PingPong
motion with coroutines to move the power-ups gently up and down to emphasize their collectible
nature. In Chapter 5, we applied concepts such as sine waves and universal First Person Controllers
to create a cross-platform PlayerController class that allowed the Player to move around the level
in first-person mode.
In Chapter 6, we explored issues of class inheritance and polymorphism by creating a base weapon
class to support a range of derived classes, implementing customized weapon functionality for the
punch and the pistol weapons. Further, these weapons were coded to use physics and ray casting
to attack and deal damage to enemy targets in range when fired. In Chapter 7, the native Unity
NavMesh asset came to our aid as we implemented intelligent Enemy characters that not only found
their way around the level, avoiding obstacles, but also exhibited patrol, chase and attack behaviors
using finite state machines.
303
 
Search WWH ::




Custom Search