Dino LCD Game

Introduction

Dino LCD Game is an interactive game inspired by the famous Dino game in Chrome, implemented on a microcontroller and displayed on an LCD screen. The player controls a dinosaur that must avoid obstacles , using a joystick. The game also includes a continuous soundtrack, a start menu and a scoring system stored in EEPROM. The goal of the project is to apply the knowledge acquired in the labs in an educational way, resulting in a portable and fully functional game. In this way, the perception of the dinosaur, that can be a little annoying because it appears when I am offline, can be slightly changed.

General description

Block scheme

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.

Hardware Design

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

Software Design

* 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.

Obtained Results

Code on GitHub : Repository

Video: Demo

Bibliography and materials

pm/prj2025/iivasciuc/cristina.margheanu.txt · Last modified: 2025/05/29 12:30 by cristina.margheanu
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0