Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Game #2, Rocket Commander 6. Add 3000 points for each city left, and add 5 new rockets to each launcher. Also, raise the level number. score += GetCityCount() * 3000 AddLauncherRockets(5) levelNumber += 1 Endif Return True 7. Now, save the mainClass.monkey file. What just happened? You have now implemented code that will spawn new bombs, check if the game is over, and also ensure that the player will get new rockets. Displaying the game score Of course, you want to display the score of the game. This can be done very easily. Time for action displaying the game score To display the game score, follow the ensuing steps: 1. Modify the RenderGame method again.