This block diagram highlights the essential components of the Dino LCD Game project and how they work together to provide a complete gaming experience:
* Arduino Uno Microcontroller – is the central control unit that reads the inputs from the joystick and generates output for sound and display.
* Joystick – allows the user to control the dinosaur (e.g. jumping). It is connected to analog and digital pins and provides the main input.
* Buzzer – controls the background sound or provides audio feedback on certain events (jump, collision).
* 16×2 LCD Display – graphically displays the game: the dinosaur, obstacles and score.
All these modules are connected to each other via Arduino, which manages the game logic, sound playback, graphical interface on the LCD, and user interaction via the joystick.
Component List
Component | Features | Purchase link |
Arduino Microcontroller | Main control unit – reads inputs from the joystick and generates outputs for sound and display. | Arduino |
Analog Joystick (with 2 button) | Control for the dinosaur jump by pushing up on the first button. To control the start of the game or the restart after the game over appears, the 2nd button on the joystick must be moved to the right. The high score system is also controlled by the first joystick , by pushing it up in the start or game over menu. | Joystick |
Passive Buzzer (5V) | For background sounds and melodies | Buzzer |
LCD 16×2 I²C | Displays the game, score and obstacles in real time | LCD |
Jumper wires | Connecting the components | Wires |
Mini breadboard | Quick assembly of components | Breadboard |
Pin configurations
LCD - Arduino * GND-GND * VCC - 5V * SDA - A4 * SCL - A5 Joystick - Arduino * D2 - D1 * A1 - A1 * GND - GND * 5V - 5V * A3 - A0
* Development environment: Arduino IDE 2.3.6
* Libraries : Wire.h(Used for I2C communication between Arduino and peripherals like the LCD display), LiquidCrystal_I2C(Extends LiquidCrystal to support I2C LCD screens, simplifying control and data handling), EEPROM.h - used to persist the player's high score
Game flow: Start Game: Display “Swipe left to Start Game” on the LCD screen. Wait for the player to swipe the second joystick to the right to start the game.
Gameplay Loop: Begin continuous game execution. Monitor joystick inputs for jump actions (left joystick) and start/restart actions (right joystick).
Game Mechanics: Jump Action: When the left joystick is pushed up, the dinosaur character performs a jump. During a jump, obstacles are cleared based on the dinosaur's movement.
Viewing the High Score: While in the Start Menu or after a Game Over, the player can push the left joystick upwards (as if jumping) to display the current high score on the LCD screen. This provides an intuitive and accessible way for the user to check their personal best without starting a new game.
Scrolling World: Every cycle, the game world scrolls to simulate movement. Randomly generate obstacles (birds or cactus) on the top and bottom rows of the world.
Collision Detection: Detect collisions between the dinosaur and obstacles. Trigger game over conditions if collisions occur, accompanied by a buzzer sound and score display.
Game Over: Upon collision detection: Display “GAME OVER!” on the LCD screen along with the final score. Wait for the player to press the right joystick to restart the game. Reset the game world and score for a new game session.
Additional Features Score Tracking: Continuously update and display the player's score on the LCD screen.
Sound Feedback: Use the buzzer to provide auditory feedback for jump actions and game over conditions.
Code on GitHub : Repository
Video: Demo