16.1. The Airhockey game

Specification

(S1) Concept

The Airhockey game is inspired by the table game of the same name. The user slides the player piece around and tries to knock the puck into the opponent’s goal. The opponent, which is run by the computer program, tries to knock the puck into the player’s goal. In order to make the game more challenging, neither the player nor the opponent can move across the center line of the playing field.

(S2) Appearance

We show a picture of it below. The ball with the triangular tail is the player, this critter is controlled by moving the mouse. The puck is the round critter, and the enemy is a robot player with an icon based on a photo of the author’s face.

The Airhockey game. ‘Robot’ sprite is a picture ...

Get Software Engineering and Computer Games now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.