Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Right now, the game is pretty pointless because you simply can't win; to fix that, you need to implement a scoring system of some description. In the case of this game, the scoring system is based on the amount of attempts (clicks) it takes the player to knock all of the asteroids out of the platform. This requires you to know how many asteroids have been knocked out of the platform, and how many clicks have been made (the score). After every click you then update the UI to show the player the current score. Once all of the asteroids have been knocked out, you end the game and show the player their final score — they win.
The first step is to set up the variable that will hold the score, so add the following declaration underneath the powerY variable at the top of the JavaScript: