If you’ve been kept busy playing the Chrome Dino Game in your browser, how about loading it onto an Arduino to leave on your desk? It’s a really simple game which runs quite well on an Arduino Uno using a simple LCD keypad shield without any other hardware.

I didn’t code this game, it’s a version I found on hackster.io which seems to run the best. It’s written in AVR C code, so it looks a bit different to the generic Arduino language but you should be able to figure a lot of it out and you can still open, edit and upload it using the Arduino IDE.

Here’s a video of the Chrome Dino Game being played on an Arduino:

What You Need To Run The Chrome Dino Game

How To Load The Game Onto Your Arduino

First, start off by plugging your LCD keypad shield onto your Arduino Uno. Make sure that all of the pins are lined up correctly so that you don’t bend any of them.

Next, plug the Arduino into your computer and start up the Arduino IDE. Make sure that the correct board is selected and that you’re working on the correct com port. Then upload the below sketch. You can also change a couple of things in the sketch if you like, I’ve outlined these after the sketch.

Here’s a brief overview of the game:

  • The game speeds up the longer you play it.
  • Cactuses are initially separated by a minimum of 5 spaces and this goes down to a minimum of 3 as the game progresses.
  • Cheating by holding down the button or continuously pressing the button is prevented.
  • The current score is displayed during the game and the high score at the end.
  • The high score is not saved and is lost when power to the Arduino is removed.

Let’s have a look at the code:

Download The Sketch – ChromeDinoGame

Playing The Chrome Dino Game On An Arduino

Things You Can Change In The Game

There are a couple of things you can edit to customise the game without knowing AVC C code, here are some of them:

  • Line 11 – Change the score/high score screen text.
  • Line 140 – Change by how much the speed increases every score increment of 5, or change the increment.
  • Line 141 – Change the maximum speed limit. The original coder suggests nothing less than 120ms a cycle or it becomes unplayable on the LCD.
  • Line 142 – Change how often the cactus spacing gets closer together.
  • Line 143 – Change the minimum cactus distance.

The game is quite easy to play on the LCD keypad shield although the buttons are not the best for quick presses and the LCD is quite slow, so it starts suffering from ghosting and brightness issues once the cactuses start moving quickly.

Let me know if you’ve loaded this game onto your Arduino Uno and what you’ve changed on it. Enjoy playing it!

Leave a Reply

Your email address will not be published.