Time for action – awarding points
In the
checkShotEnemyImpacts()
method of the WeaponManager class, add the following line after the line that readsenemy.Destroyed = true;
GameManager.Score += 10;
In the
checkRocketSplashDamage()
method of the WeaponManager class, add the following line after the line that readsenemy.Destroyed = true;
GameManager.Score += 10;
In the
DetectShutdowns()
method of the GoalManager class, add the following line right after the line that readsactiveCount--;
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
Finally, to wrap our game in a game structure, we need to build it into the Game1 class. We will include a game state tracker much like we used in Asteroid Belt Assault, with a similar division of code in the Update()
and Draw()
methods depending on...