Examples

Here are some examples of simple games that use the ideas we went over. These games aren't exactly fun, but they do use some simple concepts and the code has a lot of comments in it to explain what the functions do. Try to make your own game!


Click the Dot

See how fast you can click the dot! This simple game will generate a growing circle on the screen. Test your reaction times by clicking the new dots as fast as you can. The game will calculate your average time and display it on the screen. Be sure to read the comments in the code to see what its doing.

See the Code

Flappy Dot

In this game you must hold the mouse button for the circle to rise or release to let it fall. Navigate the circle through the gaps in the cave if you can. This game was left unpolished to show you how simple it is to make.

See the Code

HTML Games Shooter

This game displays a 2D array over the screen as blocks. Then you can use the mouse to adjust the position of a ship that can shoot at the blocks.

See the Code

Missile Defense

This game is similar to the classic missile defense game that requires you to protect your cities. The code is a little bit more complex than the previous examples. See if you can tweek the game to make it easier or better.

See the Code

Lander

Lander is a game that requires you to maneuver a moon lander to the surface of a planet without crashing. Once you land the second part of the mission requires you to dock with the orbiter. This game demonstrates using images inside a game.

See the Code

Rotator

Rotator is about quickly moving your mouse to a specific position before your ship gets hit by a wall. You also have to make sure to angle the ship to fit through using your left and right mouse buttons.

See the Code