Adding Weapons and Combat

Over the past few chapters, we built the basic framework for our game; added entities such as vehicles, aircraft, and buildings; implemented unit movement; and created a simple economy using the sidebar. We now have a game where we can start the level, earn money, purchase buildings and units, and move these units around to achieve simple goals.

In this chapter, we will implement weapons for vehicles, aircraft, and turrets. We will add the ability to process combat-based orders such as attacking, guarding, patrolling, and hunting to allow the units to fight in an intelligent way. Finally, we will implement ...

Get Pro HTML5 Games now with O’Reilly online learning.

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