ECE 4180: Dodging Asteroids
Overview
This is a a space game where the objective is to dodge asteroids. The space craft is controlled using an IMU unit's accelerometer. When the game loads, asteroids of random size, position, and velocity are generated and start veering towards the space craft. Every asteroid that the space craft successfully avoids is added to the score. The game ends when the space craft collides with an asteroid, and the final splash screen gives indicates the final score.
Demo
This demo shows the splash screen and then a brief game of dodging asteroids. From the demo, you can see that tilting the breadboard navigates the space craft and when it collides with an asteroid, the game ends with the indicated score shown.
Configuration
This game utilizes various components: an IMU unit, SD card reader, LCD screen, and analog speaker.
Components
SD Card Reader
SD Card Reader | MBED |
---|---|
VCC | VCC |
GND | GND |
CD | -- |
DO | p6 |
SCK | p7 |
DI | p5 |
CS | p8 |
IMU Breakout
IMU | MBED |
---|---|
VCC | VCC |
GND | GND |
SDA | p9 |
SCL | p10 |
uLCD Screen
SD Card Reader | MBED |
---|---|
5V+ | Vu |
GND | GND |
TX | p27 |
RX | p28 |
RES | p30 |
DI | p5 |
CS | p8 |
Analog Speaker
The analog speaker requires a driver and uses MBED's p18.
Program
Import programDodgingAsteroids
Dodging asteroids game.
Please log in to post comments.