Jumpman LCD Game

by SleepyPanda23 in Circuits > Arduino

37 Views, 0 Favorites, 0 Comments

Jumpman LCD Game

98400928-1271-4e02-b33c-8fea275dfb44.jpg

This project focuses on the rainbow of colours used in the Arduino build. Wires, the Arduino Uno, and the LCD screen all have their own unique colours.


This is a interactive and entertaining game using an Arduino and a LCD screen. The project combines hardware and software to make a simple yet enthralling game that users can play using a simple push button connected to the Arduino. The LCD screen gives the user useful feedback to use to plan their next move. One of the best things about it is that you can build it with a Elegoo Super Starter kit, which is a kit everyone that I have met has used to start their Arduino journey.


The game is a simple "Avoid the obstacles game". If the player successfully avoids the obstacle (s)he receive points. The game continues until the player collides with an obstacle. Then a Game over screen is displayed, and the player is allowed to restart.


Thanks to crepeguy for his Arduino Project Hub project. This is a cool project and I wanted to post an updated and clear version of his project.


And for the sharp-eyed observer, yes I used 2 different boards as the one board did not work for the project.

Supplies

Arduino parts.jpg

Hardware

1 Arduino Uno

1 LCD 16x2

1 Push Button

1 220 Ohm resistor

1 830 tie breadboard

Jumper wires


Software

Arduino uno 2.0 beta

Physical Setup

f28adc1a-03c0-4769-9cde-83efc880e681.jpg
20250606_182754.jpg

Follow the TinkerCad schematic and everything should go good. A few people have had problems with this project, but follow the schematic carefully and everything should go perfectly fine.

Code

Screenshot 2025-06-12 164516.jpg
Untitled.png

If you prefer to download the code it is at the bottom

newTerrainDuration = 10 + random(10);

}

}


if (buttonPushed) {

if (heroPos <= HERO_POSITION_RUN_LOWER_2) heroPos = HERO_POSITION_JUMP_1;

buttonPushed = false;

}


if (drawHero(heroPos, terrainUpper, terrainLower, distance >> 3)) {

playing = false; // The hero collided with something. Too bad.

} else {

if (heroPos == HERO_POSITION_RUN_LOWER_2 || heroPos == HERO_POSITION_JUMP_8) {

heroPos = HERO_POSITION_RUN_LOWER_1;

} else if ((heroPos >= HERO_POSITION_JUMP_3 && heroPos <= HERO_POSITION_JUMP_5) && terrainLower[HERO_HORIZONTAL_POSITION] != SPRITE_TERRAIN_EMPTY) {

heroPos = HERO_POSITION_RUN_UPPER_1;

} else if (heroPos >= HERO_POSITION_RUN_UPPER_1 && terrainLower[HERO_HORIZONTAL_POSITION] == SPRITE_TERRAIN_EMPTY) {

heroPos = HERO_POSITION_JUMP_5;

} else if (heroPos == HERO_POSITION_RUN_UPPER_2) {

heroPos = HERO_POSITION_RUN_UPPER_1;

} else {

++heroPos;

}

++distance;


digitalWrite(PIN_AUTOPLAY, terrainLower[HERO_HORIZONTAL_POSITION + 2] == SPRITE_TERRAIN_EMPTY ? HIGH : LOW);

}

delay(50);

}