Time for action – awarding points
In the
checkShotEnemyImpacts()
method of theWeaponManager
module, add the following line after the line that readsenemyTank.Destroyed = True
:GameManager.Score += 10
In the
checkRocketSplashDamage()
method of theWeaponManager
module, add the following line after the line that readsenemyTank.Destroyed = True
:GameManager.Score += 10
In the
DetectShutdowns()
method of theGoalManager
module, add the following line right after the line that reads_activeCount -= 1
: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...