The MagPi Magazine (+ HackSpace) Issue 148 features automating playing the Google T-Rex jumping game with a Pi Pico and CircuitPython:
For those who have used Google Chrome, you may have seen the screen that pops up when your internet connection fails. It’s of a pixelated T-Rex, and if you press the spacebar, you can kill time before your internet connection is restored by playing a little cactus-jumping game. If your internet goes down for a really long time, then maybe you can automate playing it.
Maker Bas op ten Berg presented us his project, the full name of which is ‘Automatic Jumping in the T-Rex Game: Detecting Cacti with a Raspberry Pi Pico CircuitPython HID Controller’, that does just that.
“Using a Raspberry Pi Pico, a light dependent resistor (LDR), a breadboard, some DuPont cables, and tape, I automated the famous Google T-Rex game,” Bas explains. “The LDR detects differences in analogue measurements whenever it senses cacti, which are always dark coloured and appear on the same plane. The analogue-digital converter [ADC] port of the Pico measures each passing cactus ten times per second. After a 0.2-second delay, the Human Interface Device [HID] library simulates pressing the ‘up’ button on the keyboard, making the T-Rex jump at the right time.”
The MagPi Issue 148, pages 30-31, Read More, Download PDF, buy now, subscribe