Demo 'Pong' Game

Play the classic arcade game "Pong" with a friend using two ZentriOS devices

API Features Demonstrated

Platforms

This app works on:

Requirements and Prerequisites

This app requires two ZentriOS devices, such as AMW106-E03 (Moray) evaluation boards. Each device requires two buttons, two LEDs and an 8x8 LED matrix display, such as provided with the Zentri ASG001 Monitor Backpack.

Description

This app uses two ZentriOS devices to implement the classic arcade video game 'Pong' to simulate a game of table tennis (aka Ping-pong).

The following instructions assume the ZentriOS device is an AMW106-E03 evaluation board connected to the LED matrix via an I2C interface. For information about using and connecting I2C peripherals to ZentriOS, see ZentriOS Peripherals

Setup Instructions

Usage Instructions

The first player to reach 5 points WINS the game!

Additional Notes

Several game variables may be changed using a ZentriOS terminal connected to either evaluation board while the game is running. These variables may be configured the same way any other ZentriOS variable is configured. The variables are:

> set pong.max_score             5   <= Max score to win a game
> set pong.pad.sensitivity      55   <= Limits speed at which the paddle can move
> set pong.pad.size              3   <= Width of the paddle in pixels
> set pong.update.increment    600   <= How fast to increase the ball speed on each increment
> set pong.update.min_interval 200   <= Minimum ball update interval (lower = faster)

A custom command is also available to restart the game at any point. The command is:

> pong_restart

Source

See:

See also: