A common pick-up in arcade games is the classic ‘Extra Life’. In implementing this quest you will add a special item that drops from certain enemeies when they die - if the player is able to touch them before they disappear, they will gain an extra life. This allows the player to decide if they want to take the risk to reach a certain part of the screen (which might be dangerous) in order to receive a reward.

Task Definition

  • Whenever an asteroid is destroyed, there should be a random chance that an extra life is dropped.
  • If an extra life is dropped, a pickup should spawn where the asteroid was destroyed and move down the screen.
  • If the player ship collides with the extra life pick-up - add one to the this.playerLives variable and destroy the pickup!

Hints

You should be able to build upon your solution from the Collisions step and the Life and Death stages in order to complete this quest.