Skip to content

PUT-PTM/STMDestroyer2016

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 

Repository files navigation

STMDestroyer2016

Overview

Our project implements a 2D computer game "Destroyer-2016". A player, who controls the destroyer by STM32F407 Discovery board, must destroy all enemy submarines.

Description

This respository consists of two main parts: STM32F4 and Unity Project.
STM32F4 is used as controller. The STM32 accelerometer detects movement and it can be interpreted by the computer.
Programming language: C

The game was created in Unity. Games are programmed using scripts there.
The destroyer of player can move along the width of the screen. This ship drops bombs to annihilate of submarines. Underwater crafts product torpedos and send them up. The player initially has 100% life but one hit reduces the "health points" of ship by 20%. Bonuses sometimes fall from the sky. Player may get more "health" or lose control of the ship by swapping sites.
The current number of levels: 3.

Tools

• Unity 5.3.4f1 Personal
• CoIDE-1.7.8 (CooCox)
• MS Visual Studio
• GIMP

How to run

Game path: *.exe file in "STMDestroyer2016\Destroyer 2016\Release" directory Click on execute file, eventually change resolution or control settings and click on "Play!" button.

Control:

UP Horizontal position of board/microUSB from leftside/miniUSB from rightside/user sees back of board
DOWN Horizontal position of board/microUSB from leftside/miniUSB from rightside/user sees front of board
LEFT Vertical position of board/miniUSB higher than microUSB
RIGHT Vertical position of board/microUSB and minijack higher than miniUSB port

Depending on the inclination of the device, the destroyer will move to the left or right. Blue button will cause the drop of depth charges.

How to compile

Connect your device to your computer with 2 wires (mini USB-USB A to power and microUSB-USB A to gamepad mode)

STM as controller:

  1. Download "STM32 ST-Link Utility" (link)
  2. Click on file and install programm
  3. Run the programm after installation
  4. Go to "Target" section and choose "Program"
  5. You see new window. Look on "File path" and click "Browse" button to find "stm32f429_project.hex" (path: "STMDestroyer2016\Destroyer 2016\Release\STM Controller")
  6. Press "Start" button
  7. Now STM32 is ready for use as gamepad

Future improvements

The explosion of the torpedo is under the water instead of on the ship. We are going to change it. Adding leadeboard.

Attributions

STM as HID USB device: Author: Tilen Majerle
Destroyer image: link
Submarine image: link
Bomb Exploding Sound: link (license: https://creativecommons.org/licenses/by/3.0/pl/)

License

License: MIT Audio: Bomb Exploding Sound: http://soundbible.com/1986-Bomb-Exploding.html license: https://creativecommons.org/licenses/by/3.0/pl/deed.en

Credits

• Jan Augustyniak
• Dominik Garczyk


The project was conducted during the Microprocessor Lab course held by the Institute of Control and Information Engineering, Poznan University of Technology.

Supervisor: Michal Fularz