Color Seeker: an mbed game

http://i.imgur.com/3Wh3w21.jpg

Color Seeker is an mbed game that utilizes various external I/O devices used by ECE 4180 students at Georgia Tech.

Hardware

The particular components involved are listed below with links to Wiki pages or data sheets.

uLCD-144-G2: https://developer.mbed.org/users/4180_1/notebook/ulcd-144-g2-128-by-128-color-lcd/
Sharp IR Sensor: http://sharp-world.com/products/device/lineup/data/pdf/datasheet/gp2y0a21yk_e.pdf
ShiftBrite RGB LED: https://developer.mbed.org/users/4180_1/notebook/shiftbrite1/
Simple Push Buttons: https://developer.mbed.org/users/4180_1/notebook/pushbuttons/
SD Card: http://developer.mbed.org/cookbook/SD-Card-File-System

For this specific game, here are the proper pin assignments for each component:

uLCD

Devicembed
5VVU
TXp27
RXp28
GNDGND
RESp30

If using the ribbon cable with the uLCD, the TX and RX labels are swapped, but the order of the pins is the same, so simply connect the pins to the mbed in order.

IR Sensor

Devicembed
Analog Inp20
PowerVU
GroundGND

It's a good idea to secure the IR sensor to the breadboard using some jumper wires for playability: IR Sensor

ShiftBrite

Devicembed
GNDGND
DIp11
LIp15
EIp16
CIp13
V+VU

The ShiftBrite is mainly for visual effect, it is not completely essential for gameplay.

Push Buttons

Buttonmbed
1 (R)p17
2 (G)p18
3 (B)p19

mbed's internal pullups are utilized in this program, so external pullups are unnecessary. Push Buttons

SD Card

Devicembed
DOp6
GNDGND
SCKp7
VCCVOUT
DIp5
CSp8

The SD card is required for storing high scores (and potentially player-modifiable game settings).

Gameplay

The primary objective across all game modes is hitting as many colored tiles as possible. There are 9 tile spaces on the screen in a 3x3 grid, and each of the three columns corresponds to an external push button (the leftmost column is red/button1, the middle is green/button2, and the rightmost is blue/button3). One of these tiles appears at a time, and to hit the tile, the player uses the IR sensor to move the yellow cursor up and down to select the desired row, then pushes the push button corresponding to the desired color/column.
Main MenuGameplay

Game Modes

There are three game modes that provide variations on the core gameplay.

Survival

Pressing Button 1 on the main menu enters Survival mode. In this game mode, the player has an unlimited amount of time to correctly hit as many tiles as possible. Each time the player incorrectly hits a tile, a life is lost, and when all lives are lost, the game is over.

Though there is no limit on total gameplay time, there is a limit to the amount of time the player has to hit the current tile. This limit decreases slightly as the player's score increases. If the player takes too long to hit a tile, it is treated as an incorrect hit.

Speed

Pressing Button 2 on the main menu enters Speed mode. In this game mode, the player has a certain amount of time to correctly hit as many tiles as possible. When time runs out, the game is over.

There is no penalty for incorrect tiles other than the time wasted by incorrectly hitting a tile.

Sequence

Pressing Button 3 on the main menu enters Sequence mode. In this game mode, instead of displaying a single tile to be hit, the game plays a sequence of tiles, and the player needs to remember the sequence and echo it correctly in order to receive a point. The initial sequence is one tile long, and following each correct echoing of the given sequence by the player, an additional tile is appended to the existing sequence. If the player incorrectly echoes the sequence, a life is lost, and the game replays the existing sequence (without appending an additional tile) and again prompts the user to echo it. When all lives are lost, the game is over.

This game mode is analogous to the popular electronic game Simon.

There is no restriction on the amount of time the player has to echo the sequence.

Video Demo

This video demonstrates all three game modes.

Software

Get the program here:

Import programColor_Seeker

A game for mbed involving various external I/O used in ECE 4180 at Georgia Tech.

Current Version: 1.1

Changelog

v1.1
-High Scores now save and load properly
v1.0
-Initial Release

Planned Features

-Player modifiable settings that can be configured prior to gameplay (number of lives, gameplay time, difficulty)
-Game sounds using a speaker


Please log in to post comments.