ECE 4180 Design Project - Turn-Based Survival Game
Group Members
- Saketh Poda - Section B
- Ashwin Subramanian - Section A
Summary
The game was developed using Unity and Visual Studio. It is a single-player, turn-based survival game with an indefinite number of randomly-generated levels, and the levels become progressively more difficult. We imported image files into Unity to create the game's visuals and player and enemy animations, and audio files for the main audio and the sound effects. We wrote C# scripts to handle the game's logic. This encompasses player and enemy movements, interactions with game objects, and game management in general. We wrote C++ code to write to the serial port on the PC to read the joystick input via the mbed, and C# code in Unity/Visual Studio to read the serial port in order to get the input directions.
The player uses a joystick (SparkFun 5-Way Tactile Switch Breakout Board) to move the protagonist up, down, left, or right. The player can only move to an empty space or chop trees. Each tree requires four chops to fall and then that space becomes an empty space. The player can also be attacked by two types of enemies, a bug and a Yoshi. As this game is turn-based, the player and enemies take turns performing actions. Fortunately, there are blue and red hearts scattered around the map to restore the player's health, with a blue heart restoring 10 points and a red heart restoring 20 points. Each time the player moves or performs a chop, he loses one health point. Each time he is attacked by a bug, he loses 10 points, and when attacked by a Yoshi, he loses 20 points. When the player's health points run out, the game ends. Each level must be completed by reaching the blue door at the top-right corner of the map.
Hardware/Software Used
- SparkFun 5-Way Tactile Switch Breakout Board
- mbed LPC1768
- PC with Windows 10
- Unity - version 5.4
- Microsoft Visual Studio - C#
- ARM mbed Developer - C++
Wiring Guide
mbed LPC 1768 | SparkFun Nav Switch Breakout |
---|---|
gnd | - |
p24 | U - up |
p25 | C - center/fire |
p26 | L - left |
p27 | D - down |
p28 | R - right |
nc - using internal pullups | + |
Circuit Picture
Game Demo
C++ Code
Import programECE4180FinalProject
C++ Code for the final project, to write input data from the joystick to the serial port through the mbed.
C# Code
Please log in to post comments.