Please enable JavaScript to use CodeHS

Breakout

In this project, students will use JavaScript graphics to create a fully functioning breakout game.

Hard

8 Hours

High School

Project Description

Your goal in this assignment is to create a breakout game. We will start by making the bricks.

There are NUM_ROWS rows of bricks, with NUM_BRICKS_PER_ROW bricks per row. You should write everything in terms of these constants, and use loops and functions to avoid redundant code.

Specifications

The first two rows are red, then the next two are orange, then the next two are green, then the next two are blue. Then the same pattern repeats for rows 9 and up. (hint: %)

Add the ball and paddle. The ball should bounce around the screen. The paddle should move with the mouse.

The last part of the game is to get collisions working. You should remove bricks when the balls collide with them. This is very similar to bouncing the ball.

Project Demo

Explore this program before assigning it!

Project Overview

Here is an outline of the project activities: