Dr. Round is an astronaut on the ISS in the year 2203. While on a space walk, Dr. Round accidentally dropped a bomb that he held and now the bomb is on its way hurling to hit Earth.
An object when dropped in space can hit the earth with so much force that it releases enough energy to annihilate the earth.
Luckily the international space agency had preventive measures just in case such a situation arises. It had a series of rocket powered platforms that help to slow down the speed of the ball before it annihilates the earth. But due to poor maintainance a few of these platforms can trigger the bomb to explode.
- Arduino UNO
- ADXL345 Accelerometer
- 1.44" TFT Display
Follow these links to connect the arduino to the the sensors -
Upload new_game/new_game.ino to the arduino to play the game on the tft screen.
This is a platform game where the end goal of the user is to get the bomb as close to the earth as possible. We start by first setting the stage by drawing the bomb and the platforms after which the game's event loop is initiated. In each loop we read the accelerometer values and based on the tilt of the accelerometer we move the bomb. While the bomb is in motion we check if the bomb has collided with any of the platforms. If it hasnt we let the ball fall. If it has, we then check if it has been resting on the platform or it has just landed on the platform. If the case is the latter we increase the score, else we continue the game. If we notice that the bomb has hit the bottom platform, then we move the camera downwards by raising the bottom most platform to the first platform and introducing new platforms.
Hero/player of the game. The object has to cross various platforms inorder score points.
- Green Platform: This is the basic platform on which the ball will land.
- Yellow Platform: This is a platform with a to and fro motion.
- Red Platform: This is a pass through platform.
The spikes are the obstacle which should be avoided by the ball.
The game complexity would increase with the increase in the game score. The complexity would with indroduced in the following ways:
- Increase in the ball sensitivity
- Reducing the plaform size
- Increase the platform speed
- Introducing the various platforms at random
- Introducing spikes on the platform
Score of the game would increase by 1 unit as soon as the ball hits a particular platform.
The game would end when the ball falls out of the screen.
The code in this repository is divided into the following structure
├── BlockDiagram.jpg
├── circuit_bb.png
├── circuit.fzz
├── main
│ └── main.ino
├── README.md
└── test
├── adxl345_test
│ ├── accel.h
│ └── adxl345_test.ino
├── anim_test
│ └── anim_test.ino
└── bounce
└── bounce.ino
- The main code is in the main folder.
- Open the main.ino file in the arduino IDE.
- Connect the arduino to the computer.
- Upload the code to the arduino.
- Open the serial monitor and set the baud rate to 9600. (OPTIONAL)
- The game should start on the tft display.
- This folder contains the test code for the accelerometer and the tft display.
- The accelerometer test code is in the adxl345_test folder.
- The tft display test code is in the anim_test folder.
- The bounce test code is in the bounce folder.
- This folder contains the main code for the game.
- It has all the libraries and headers bundled in the main.ino file.
- Adafruit GFX: This library is used to draw shapes on the tft display.
- Adafruit ST7735 and ST7789 Library: This library is used to control the tft display.
- Adafruit BusIO: This library is used to communicate with the accelerometer.
- Adafruit ADXL345: This library is used to control the accelerometer.
- SPI: This library is used to communicate with the tft display.
- Wire: This library is used to communicate with the accelerometer.


