[JavaScript] Breakout Game

Completed demo.

I followed the tutorial "2D breakout game using pure JavaScript" by MDN, then added the following changes:

  1. More random ball launch:
    • Begin at random horizontal positions instead of center.
    • Ball launches either to the left or right instead of only right.
  2. Ball Statuses:
    1. Before launching
    2. During game.
    3. After winning

    Status 1 allows the ball to launch at a key-press or mouse-click, instead of launching as soon as the page loads.

    Status 3 allows the player to stay on the page after winning to enjoy the sight of the clean canvas, while manouvering the paddle.

    Also fixed the unsatisfying bug that the last block remains on canvas after winning.

  3. User Input Ball Speed:
  4. Ball speed can be updated before each launch, but real-time update of ball speed would be more ideal.