The game we're building is a simple side-scrolling racing game. The player's car is static on the screen, only the background is moving. The enemies are planes whom the player must dodge using the up and down arrow keys. If the player hits a plane, he dies. One point is given each time a plane goes off screen without touching the player.
Our game is composed of sprites. Each sprite has a position (x, y), velocity (speed) and one image, or more if animated.
Images are loaded from the DOM using their CSS selector (
imagesSelector). We use ID selectors (
#name) for single images and class selectors (
.name) for animated sprites composed of several images.
See the images used in the game.