W1606 Score

From Coder Merlin
Within these castle walls be forged Mavens of Computer Science ...
— Merlin, The Coder

DRAFT ICON

Prerequisites[edit]

W1605 Only One

Exercises[edit]

  1. Add collision detection so that you are able to determine if the ball "hits" a paddle
    1. If the ball hits a paddle, it should bounce off in exactly the same way that it would bounce from the left or right edge of the canvas
  2. Track the score
    1. Begin with both the right and left sides at 0
    2. If a ball hits the left side of the canvas, then right's points increase by 1
    3. If a ball hits the right side of the canvas, then left's points increase by 1
    4. A side wins when their score reaches 9
  3. Display the score using large digits toward the top of the canvas
  4. When the game is over:
    1. Display a "Game Over" message over the entire canvas
    2. Hide the paddles
    3. Do not increment the score
    4. The ball should continue to bounce from edges as before