Time for action – awarding points

  1. In the checkShotEnemyImpacts() method of the WeaponManager class, add the following line after the line that reads enemy.Destroyed = true;
    GameManager.Score += 10;
  2. In the checkRocketSplashDamage() method of the WeaponManager class, add the following line after the line that reads enemy.Destroyed = true;
    GameManager.Score += 10;
  3. In the DetectShutdowns() method of the GoalManager class, add the following line right after the line that reads activeCount--;
    GameManager.Score += 100;

What just happened?

Since we can destroy enemies with either normal shots or rocket splash damage, we need to award points in either case. Shutting down a computer is worth ten times as many points as destroying a single enemy.

Updating Game1 ...

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.