LCD Minigame at Home

by Yoyonova in Circuits > Arduino

105 Views, 0 Favorites, 0 Comments

LCD Minigame at Home

IMG_3107.jpg
SonicGames.jpg

I have fond childhood memories of those little sonic LCD games that you could get from McDonald's in the mid 2000's. Sadly, any I had have been lost or thrown away over time.

So, I decided to take matters into my own hands - and make my own LCD game!

Supplies

IMG_3110.jpg
IMG_3075.jpg
IMG_3079.jpg

Components

  • Arduino Uno R3
  • 16x2 LCD
  • 2 Push Buttons
  • 220 Ohm Resistor
  • A bunch of wires (about 20)
  • Breadboard
  • Casing (I used some cardboard packaging)

Tools

  • Scissors
  • Soldering Equipment

Description of the Game

SimulatedGameplay.png
BananaCatch.jpg

In this game, the player uses 2 buttons to move their character left and right, trying to collect all the coins that are falling from the sky. It was designed to resemble an old Sega LCD game where you have to catch falling bananas.

Digital Circuit

circuit2.png

Before I started physically building anything, I wanted to simulate everything digitally. I decided to use Tinkercad for this purpose.

For the circuit, I connected the LCD to pins 2-6, 11 and 12 as seen in the diagram. I made sure to use a 220 Ohm resistor when connecting the LCD to the 5V power.

I connected the buttons to pins 7 and 8.

That's all for the components - now I just needed code for the game.

Game Code

The game itself is pretty simple. The game moves all coins down 1 space every second, and then randomly spawns new coins at the top. The player moves left/right if the buttons are pressed. If the player touches a coin, it disappears and adds 1 to the score.

The biggest issue was that I needed 3 columns for the falling coins - but the display only has 2! This meant having to virtually split the display into 3 columns, using custom characters to actually display the coins and player.

Building the Actual Thing

IMG_3097.jpg
ActualThing.png

Now that everything was functioning properly in the digital version, I could start building the real thing.

I soldered 12 wires to the LCD. Then I connected the LCD and the 2 buttons as in the diagram, using a small breadboard for the power and ground wires. Finally, I uploaded the code and crossed my fingers.

And... it works! Luckily, all the components behaved just like they did in the simulated version.

Encasing

IMG_3090.jpg
IMG_3091.jpg
IMG_3093.jpg
IMG_3094.jpg
IMG_3100.jpg
IMG_3103.jpg
IMG_3109.jpg
DIY LCD Minigame

The loose components weren't very usable by themselves, so I set out to give them a casing. I decided to use some simple cardboard packaging, cutting the appropriate holes in it. I attached the buttons and screen to the casing and closed everything off. (I also drew some hideous art on the casing.)

Now the game was actually playable!

Reflection

This is the first Arduino Project I have actually finished, and I learned a lot! Soldering was daunting at first, but turned out to be very doable. The code libraries, in particular the one for the LCD, took some getting used to but were pretty nice to work with in the end.

The game code as it is is pretty barebones. It could use a lives system, and a gradual speed-up to increase the challenge. I could also add versions of some of the other Sonic LCD games, like the one where you have to dodge incoming projectiles.

The biggest thing I would do differently in the future is the casing. The cardboard I used is very flimsy, and a little too big for the components. 3D printing appropriate casing could greatly increase the ease of use of the game.