Recreating the Iconic "Lonely T-Rex" Game

by EJ_776417 in Circuits > Arduino

93 Views, 0 Favorites, 0 Comments

Recreating the Iconic "Lonely T-Rex" Game

20260611_190821.jpg
tinkerCad.png

In this project, I recreate the Chrome Dino game on an Arduino using a 16x2 I2C LCD, a pushbutton, and a transistor-based multivibrator circuit. This Arduino based game includes majority of the core game mechanics seen in the original Lonely T-Rex game, such as obstacles, scoring, and the dinosaur jump animation. The LCD renders the game's graphics, the pushbutton controls both starting the game and making the dinosaur jump, and the four-LED multivibrator adds a visual effect by flashing whenever you reach the main screen or die with a high score.

Supplies

Components.png

Keep in mind that many of these products are only available as multipacks in the links provided despite the project only using a few components.

  1. Solderless Breadboard (1)
  2. Arduino (1)
  3. Hook-Up Wires
  4. LCD I2C (1)
  5. Pushbutton (1)
  6. 10k Ω resistors (3)
  7. 330 Ω resistors (2)
  8. Green 5mm LEDs (4)
  9. 100 µF 16V Capacitors (2)
  10. NPN Transistors (2)

Note that this guide specifically uses an I2C LCD. If you chose to use a different LCD, you will have to wire it differently.

Setting Up the Breadboard Rails and Wiring the LCD

step1.png
lcd1.png
20260611_174804.jpg

Connect the power and ground rails of the breadboard to 5V and GND on the Arduino respectively. Then connect the power and ground rails on the opposite sides of the breadboard together. This is essential for the components to work. Power coming directly from the Arduino 5V pin is denoted with the red wires. Ground connections are black.

You may notice that there are four connections on the top left corner of the breadboard. These connections will allow the Arduino to control the LCD.

If you flip over your I2C LCD component, you will see that there are 4 labelled pins.

The pin labelled GND/ground will connect to the row where the black wire is connected. The pin labelled VCC/power will connect to the row with the red wire. The pin labelled SDA(Serial Data) will go to the row with the green wire, this connection being after the AREF pin on the Arduino. Lastly, the pin labelled SCL(Serial Clock) on the LCD will go into the row with the yellow wire connection, this yellow wire going to the pin after the SDA pin.

The SDA and SCL pins on the Arduino are dedicated to I2C LCD communication, which makes wiring the LCD pretty straightforward.

Wiring the Pushbutton

20260611_174901.jpg
tinkercad0.png

The breadboard row connected to the bottom left of the pushbutton is connected to ground using a 10k Ω resistor. The row connected to the bottom right side of the pushbutton is connected to red and the row connected to the top left of the button is connected to Arduino pin 9 using the yellow wire.

The yellow wire connected to Arduino pin 9 will let the Arduino read the button input which will let the game start and control the dinosaur's jumps.

Currently the button will do nothing because we haven't coded it to perform any tasks.

Placing the LEDs

20260611_175315.jpg

This is the start of the multivibrator circuit.

The multivibrator circuit will create a flashing effect. The two LEDs on each side will only turn on when the two LEDs on the other side are off. The two sides will alternate between being on and off.

The anode of one green LED from each side is connected to a 330 Ω resistor. Through this resistor, the LEDs will get power.

The first 300 Ω resistor will send power to the top pair of LEDs and the second resistor will power the bottom two LEDs.

Working on the Multiibrator

stepp4.png

Connect the anodes of the two LEDs on each side together and the anodes together. In the image shown, the anodes are connected together using yellow wire and the cathodes with green wire. Doing this causes the LED pairs to turn on and off together.

The cathode of the polarized capacitors will be connected to the 10k Ω resistors and the anode will be connected to the cathode of their respective LED pairs (which is where the green wire connection is).

The cathode of the capacitors will also be connected to the middle leg (base leg) of their own NPN transistors, this being shown with the blue wire connection.

The collector of the transistor is connected to the ground rail, as shown with the black wire.

The yellow oval drawn that surrounds one of the breadboard rows will eventually send power to the multivibrator circuit when connected to an Arduino pin.


Normally with polarized capacitors, if you wire them backwards, the component gets damaged. In this circuit, since the current reaching the capacitor is extremely low because of the resistors present, nothing will happen. You should still try to wire them properly to ensure that the component doesn't get damaged over time.

Completing the Multivibrator

20260611_185732.jpg
20260611_185921.jpg
FDB5B5UMPX8QSLE.png

Add in the missing connections.

The emitter of each transistor should connect to the anode of the opposite capacitor. I've done this with green wire.

I then connected each resistor to the power row using yellow wire.

Connect the power row to Arduino pin 11. Arduino pin 11 will be coded to only send power to the now completed multivibrator circuit when the player dies with a high score or enters the main menu screen.

We have finally completed the physical circuit! Now we move on to the code.

Coding

The code provided is complete and if you upload it onto your Arduino, it should work as if without any changes unless you used different Arduino pins for the multivibrator or button.

The code contains comments to help you understand the logic better.

I have also included a resources section with links to websites containing information I found useful while making this project.

You can see the project in action in the video.

Resources