A handheld game console on STM32F4 Discovery Board that allow you to play a game called Return to Earth - a fun asteroid shooting game.

Some background
I was taking a driver development course base on STM32F407 MCUs on Udemy and the Embedded System - Shape The World: Multi-Threaded Interfacing on Edx. As a final project, I thought it would be cool to combine all the developed drivers (GPIO, ADC, DAC, SPI…) and build a very own portable game console. The console will allow you to play a simplified version of Asteroid - the famous and fun arcade game. This game was written base on a Youtube tultorial from OneLoneCoder.

How to play?
The player will need to use the joystick to change the heading direction of the spaceship (in North, South, East, West, North East, South East, North West, South West); press the B2 (lower) button to apply thrust and move the spaceship; and press the B1 (upper) button to fire rocket at the moving asteroids. As player ‘s spaceship collided with one of the asteroids, the game will ended.

There is some few things to notice when playing the game:

+Player ‘s spaceship, asteroids, rockets will all move in a special dimension: When moving and disappearing at the right edge, the object will slowly appear at the left edge of the screen, and vice versa. The same thing happen with the above and below edge, as well.

+The more user press the B2, the faster the spaceship will move in space.

+When user stop pressing the B2 button, the spaceship will keep floating with a decreasing speed for a while before reaching a full stop.

+Whenever player press the B1, 1 point will be deducted from the total score. The maximum number of rockets that player can shoot as a time is 3; this mean that player need to wait until 1 of the 3 rockets to disappear in order to fire a new one. (When 3 rockets appear on the screen and player keep pressing the B1 button, nothing will happen.)

+Whenever player hit an asteroid with rocket, 10 points will be added to the total score. If player hit a big-size asteroid, two small-size ones with double the speed of the big-size will appear.

The goal of the game is to clear all 5 waves of asteroids and earn the highest score possible.”

Link

Related Content