Skip to main content
Version: FILS English

Don't Touch The Spikes

Don't Touch The Spikes game based on a raspberry pi pico 2W

info

Description​

In this project, I want to recreate the game Don’t touch the spikes on a Raspberry Pi, using an LCD display which will work using Embedded-graphics. The player controls a bird using a joystick, while a separate button is used to restart the game after it ends. The bird moves within four walls with spikes and must collect randomly appearing food to increase the score, which is shown on a 4-digit 7-segment display. As the player progresses, the difficulty increases: at a score of 5, an enemy character appears that the bird must avoid; at 10 points, a second enemy is introduced; and at 15 points, three LEDs light up. Buzzers are used to provide sound effects when the player scores or loses. The game ends when the bird touches a spike or an enemy character.

Motivation​

When I was a child, Don’t touch the spikes was one of my favorite games. I remember spending hours playing it with my cousin, always competing to beat each other's high scores. I was fascinated by how such a simple game could be so fun and addictive, and I wondered how it was made. Now, as a university student, I’m excited to finally have the opportunity to learn the skills needed. This project allows me to apply the technical skills I’ve gained while also reconnecting with a childhood memory.

Architecture​

architecture

β€’ Raspberry Pi Pico 2W

Acts as the main microcontroller that runs the game logic, handles input from components, drives the display, and controls game events like scoring and game over.

β€’ LCD Screen

– SPI - Raspberry Pi Pico 2W

Displays the game's graphics using the Embedded-graphics library.

β€’ Joystick

– ADC - Raspberry Pi Pico 2W

Serves as the player's input device to control the movement of the bird within the game area.

β€’ 4-Digit 7-Segment Display

– GPIO - Raspberry Pi Pico 2W

Shows the player's current score in real-time as they collect food during the game.

β€’ Buzzer

– PWM - Raspberry Pi Pico 2W

Provides sound effects for scoring or losing

β€’ Breadboard

Used to connect all the electronic components

β€’ Push Button

– GPIO - Raspberry Pi Pico 2W

reset button

β€’ Wires

Used to connect all components to the Raspberry Pi Pico

β€’ LEDs

– GPIO - Raspberry Pi Pico 2W

Light up when the player reaches certain scores

Log​

  • Week 5 - 11 May: Planned the architecture of the project, bought all the required components and created the documentation of the project.
  • Week 12 - 18 May:
  • Week 19 - 25 May:

Hardware​

hardware

Schematics​

KiCAD schematics

KiCAD scheme

Bill of Materials​

DeviceUsagePrice
Raspberry Pi Pico 2Wthe microcontroller40 RON
LCD screendisplays the game70 RON
Joystickplayer's input device5.41 RON
4-Digit 7-Segment Displaycurrent score in real-time6.10 RON
Buzzersound effects1.4 RON
Breadboardconnect all the electronic components10 RON
Push Buttonrestart the game1.02 RON
Wiresconnect the components10 RON
LEDslight up after a certain score0.3 RON

Software​

LibraryDescriptionUsage
embedded-graphics2D graphics libraryUsed for drawing to the display
embassy-embedded-halSPI and I2C libraryUsed for actually configuring the SPI lcd
embassy-rpClosest to a default libraryUsed for SPI, GPIO pins and peripherals
randRust crate for random number generatingUsed for creating a random position for the "food"
heaplessEnables the use of fixed-size data structures that do not require heap memoryManaging strings and vectors that have a fixed capacity
embassy-timeProvides time-related utilitiesManaging delays and scheduling tasks
ili9341Driver for TFT LCDs using the ILI9341 controllerRender 2D game graphics
driver-3461bs-rsSupports functions for controlling the screen's pixels, colors, and other display settingsRender text, graphics, or animations on the screen
adcADC driverUser for controlling the joysticks
pwmPWM moduleUsed for controlling the buzzer

https://t1willi.itch.io/dont-touch-the-spikes