ends the game. Or alternatively, maybe the score depends only on how long the user has stayed alive, and the user dies when they've hit more bad things than good things. There are many possibilities here. Complete the getScore method, which should return the current game score. In determining the score, you may use timesGet, times
The fields timesGet and timesAvoid should each influence either the score, or the game-over condition, or both. For example, maybe getting something good increases the score, hitting something bad decreases the score, and the game ends after a set amount of time. Or alternatively, maybe getting something good increases the score, and hitting a certain number of bad things ends the game. Or alternatively, maybe the score depends only on how long the user has stayed alive, and the user dies when they've hit more bad things than good things. There are many possibilities here. Complete the getScore method, which should return the current game score. In determining the score, you may use timesGet, timesAvoid, and msElapsed. Then modify updateTitle to show the title of your game. (You're welcome to show other statistics in the title, in addition to the score.) Test that the score now updates correctly, as you play your game and collide with images.
Step by step
Solved in 3 steps