F19: T-Rex Run!
Contents
T-Rex Run!
Abstract
T-Rex Run! game is an adaptation of popular chrome browser offline game in which the player steers a T-Rex dinosaur through increasingly dangerous landscapes to escape a tree of doom. The game uses simple pixel art and sound to replicate the style of 1980s arcade games. The player will be able to control the game by using switch buttons available on the Sjtwo-C microcontroller. The main goal behind the project is to understand the basics of graphics programming in the C language on a microcontroller.
Objectives & Introduction
The primary objective of this project is to write efficient code to develop a game using FreeRTOS and SJTwo Board. SJTwo Boards act as the heart of the project which acts as the controller of the game which we primarily test using onboard switch controlled with GPIO. The main objective which we are achieving with is to use the accelerometer sensor as a controlling aspect. The accelerometer sensor on the SJTwo board which is connected via I2C is used to register the controller orientation and according to the orientation obtained by the sensor, game logic decides whether to make dinosaur jump up or not. The obstacles are generated randomly and are moved from left to right on the LED matrix. If dinosaur collides with any of the obstacles its game over. The speed of obstacle movement increases as the levels goes up.
The project includes the following modules:
1. Controller: One SJTwo board is used as the controller. It transmits orientation to the processor.
2. Display Module: Adafruit 32x32 Led Matrix display is used to display the game. This is driven by the GPIO pins on the master SJOTwo Board.
Team Members & Responsibilities
- Tina Ruchandani
- Accelerometer Calibration & Control.
- Software Design (Switch control and Obstacle Generation).
- Wiki Page Updates.
- Tushar Tarihalkar
- LED Matrix Interface.
- Wiki Page Updates.
- PCB and Hardware Design
- Software Design (Dinosaur Design and Control).
- Wenyan He
- Software Design (Switch control and Obstacle Generation).
- LED Matrix Interface
- Manage GitHub Account
- Mahesh Mohan Shinde
- LED Matrix Interface.
- Collision Detection.
- Testing.
- Wiki Page Updates.
Schedule
Week | Date | Task | Status |
---|---|---|---|
1 | 10/08 |
|
|
2 | 10/10 |
|
|
3 | 10/15 |
|
|
4 | 10/29 |
|
|
5 | 11/13 |
|
|
6 | 11/19 |
|
|
7 | 11/26 |
|
|
8 | 12/03 |
|
|
8 | 12/10 |
|
|
8 | 12/18 |
|
|
Parts List & Cost
Part | # | Cost | Source |
---|---|---|---|
SJ2 Board | 1 | $55.00 | Preet |
Adafruit RGB (32x32) LED Matrix Display | 1 | $60.80 | Amazon |
5V/4A Power Adapter | 1 | $8.99 | Amazon |
Female DC Power adapter - 2.1mm jack | 1 | $2.99 | Adafruit |
Jumper Wires | 1 | $6.99 | Amazon |
Design & Implementation
The block diagram for the project given below depicts the flow of the game
The design section can go over your hardware and software design. Organize this section using sub-sections that go over your design and implementation.
Hardware Design
The hardware design for the project consists of a 32x32 RGB LED matrix operated using SJTWO Board (LPC4078). The RGB LED matrix is controlled using GPIO pins available on the microcontroller. The functioning of the LED matrix is basically controlled by the four data lines A, B, C and D which can be addressed and used to control each LED on the Matrix.
LED Matrix specifications:
- 190.5mm x 190.5mm x 14mm / 7.5" x 7.5" x 0.55"
- Panel weight with IDC cables and power cable: 357.51g
- 5V regulated power input, 4A max (all LEDs on)
- 5V data logic level input
- 2000 mcd LEDs on 6mm pitch
- 1/16 scan rate
Label | Name | Pin Function |
---|---|---|
1 | R1 | Red data for top half of the LED Matrix |
2 | G1 | Green data for top half of the LED Matrix |
3 | B1 | Blue data for top half of the LED Matrix |
4 | A | Select line A |
5 | B | Select line B |
6 | C | Select line C |
7 | D | Select line D |
8 | R2 | Red data for bottom half of the LED Matrix |
9 | B2 | Blue data for bottom half of the LED Matrix |
10 | G2 | Green data for bottom half of the LED Matrix |
11 | CLK | CLOCK Pin |
12 | LAT | LATCH |
13 | OE | Output Enable |
14 | GND | Ground |
Hardware Interface
In this section, you can describe how your hardware communicates, such as which BUSes used. You can discuss your driver implementation here, such that the Software Design section is isolated to talk about high level workings rather than inner working of your project.
Software Design
Show your software design. For example, if you are designing an MP3 Player, show the tasks that you are using, and what they are doing at a high level. Do not show the details of the code. For example, do not show exact code, but you may show psuedocode and fragments of code. Keep in mind that you are showing DESIGN of your software, not the inner workings of it.
Implementation
This section includes implementation, but again, not the details, just the high level. For example, you can list the steps it takes to communicate over a sensor, or the steps needed to write a page of memory onto SPI Flash. You can include sub-sections for each of your component implementation.
Testing & Technical Challenges
Describe the challenges of your project. What advise would you give yourself or someone else if your project can be started from scratch again? Make a smooth transition to testing section and described what it took to test your project.
Include sub-sections that list out a problem and solution, such as:
Bug/issue name
Discuss the issue and resolution.
Conclusion
Conclude your project here. You can recap your testing and problems. You should address the "so what" part here to indicate what you ultimately learnt from this project. How has this project increased your knowledge?
Project Video
Upload a video of your project and post the link here.
Project Source Code
References
Acknowledgement
Any acknowledgement that you may wish to provide can be included here.
References Used
List any references used in project.
Appendix
You can list the references you used.