Adding weaponry

Now that we can create special effects for our weaponry, we need to actually add the weapons to the game! We will begin with a basic cannon, and then modify the Player class to support upgraded weaponry.

The WeaponManager class

Once again, we will use a "manager" class to handle the shots fired in the game. This time though, we will be dealing with player fired shots and enemy fired shots separately because players will have more options on exactly what they can shoot than the enemy tanks will.

Get XNA 4.0 Game Development by Example Beginner's Guide 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.