This code represents an advanced version of the game Breakout. It takes the retro game and makes it easy to play on your computer, while still keeping the original feel of it.
There are 3 rows of bricks, 1 paddle, and 1 ball.
To win the game, you must clear all of the bricks. You have 3 lives to try to win the game.
While the ball will move around the sreen hitting the bricks and increasing your score, you need to move the paddle along the bottom in order to not let the ball touch the bottom of the game. If the ball touches the bottom, you lose a life.
Each brick has a diffrent difficulty level. The ones on the bottom only need to be hit once, the ones in the middle need to be hit twice, and the ones on the top need to be hit three times. Each time a brick disapeers,your score will go up by one point.
This game includes a wide range of features of JavaScript, including functions, variables, arrays, objects, if-else, and loops.
This code was taken from basic vanilla JavaScript, to modern JavaScript syntax with refacturation to include OOP techniques. It was therefore taken from a simple, but messy code to code that applies best practice.