My project is a copy of the popular Google Chrome dinosaur jump mini-game that uses the Arduino UNO R3 as the “brains”.
The inspiration to make this project came when I realized that my PC had no internet connection and I started playing the mini-game out of boredom.
My aim in creating the game was to replicate the addictive and fun game that we all played at least once when we had no internet. I believe that this project is a great way to enhance your skills in Arduino programming and in electronics.
My project is a copy of the Google Chrome dinosaur jump mini-game replicated using an Arduino UNO R3 to run the program, a 16×2 LCD with I2C module to display the game, a button to control the dinosaur's jumps and a piezo buzzer to play certain sounds during the game in order to keep the player updated on certain events. The game starts the moment that the player presses the button and then, as the game progresses, the player must correctly time the jumps and dodges in order to avoid cactuses on ground and birds on air. In order to increase the difficulty, as time passes by, the game's speed increases and therefore its challenge level. The software treats the first row of the LCD as the sky and the second one as the ground. The buzzer is used to play jump sounds, death sounds, and score sounds, giving to the player a retro style “soundtrack”.
List of parts used in this project:
Other small components:
The game code is based on the project by the youtube channel: Max Imagination.
I used the latest version of the Arduino IDE for the software development of this game, making use of its compilation error checking and nice black background .
The code includes several libraries that provide additional functionality to the Arduino system:
Of course, The code uses various global variables that are used throughout the program for tracking certain events, updating the points, raising the difficulty of the game, etc.
All the user defined functions that the program uses are:
Interrupt Service Routine (ISR) The code defines an Interrupt Service Routine (ISR) for handling a timer interrupt. The timer interrupt is used to control the timing and execution of the points system, as well as running animation for the dinosaur while he is on the ground.
At first I thought this project will be quite straight forward and honestly, quite boring. But as soon as I found a project that really called out to me and decided to improve upon the original code, the more I started to enjoy working on this project. It is certainly is a challenge to make sure the code you develop is easy to understand, works as intended and most importantly, does not have redundant pieces of code. The hardware side was quite straight forward considering that I use a I2C module for the LCD and the other components are a passive 3.3V buzzer and a button.
The source code for the project in case you want to play the game yourself!