Dropping Block Game
This is a Dr. Mario and Tetris style video game that can be created on the MBED. There are special blocks on the display that the player must eliminate. To eliminate a row of blocks, the player must place an entire row of the same color. The player wins when all of the special tiles are eliminated, and loses if the falling blocks reach the top of the board.
This project requires a Joystick for user input, a uLCD-144-G2 for displaying the game, and a MOSFET driver to power a motor for haptic feedback.
Joystick instructions:
The 5-way joystick can be connected to the digital pins of the MBED. Each direction on the joystick requires one digital-in pin on the MBED. Here is a wiring table used for the joystick:
Mbed | Joystick |
---|---|
P14 | U |
p15 | D |
p16 | L |
p17 | R |
p19 | C |
VOUT | + |
GND | - |
More information on the 5-way Joystick can be found here: https://developer.mbed.org/users/4180_1/notebook/using-a-navigation-switch-digital-joystick/
uLCD instructions:
The uLCD requires a serial connection to control the display. It also requires a 5V supply [VU] (not the 3.3V). Here is the wiring table for the uLCD:
uLCD | Mbed |
---|---|
VU | 5V |
GND | GND |
p9 | RX |
p10 | TX |
p11 | Reset |
MOSFET instructions:
The mosfet requires a PwmOut pin. Here is the wiring table:
Mbed | MOSFET driver |
---|---|
P21 | C |
GND | system - |
MOSFET driver | motor |
---|---|
device+ | + |
device- | - |
external power | Mbed |
---|---|
+ | VU |
- | GND |
A demo of this game in action:
Here is the code:
Import program4180_LAB4
Falling block game
Please log in to post comments.