Escape Game: LOCKED in Space
by HanneHellinMCT in Circuits > Raspberry Pi
183 Views, 1 Favorites, 0 Comments
Escape Game: LOCKED in Space
I'm a student at Howest Kortrijk and studying MCT which stands for Multimedia Communication & Technology.
For the project one, I created an escape game. This in theme of space. A control panel works together with a webapp on which you can follow the story to play a fun game. I used to play escape board games often. That's why I wanted to make my own.
Here the link to my GitHub
Supplies
Electronics:
- Rapsberry pi 4 with a 16gb+ sd card
- Arduino uno
- RPi powersupply
- Breadboard power supply
- AC/DC power adapter
- Raspberry Pi breakout expansion board + ribbon cable
- Dupont wires (various sizes and types)
Sensors:
- 6 buttons
- 4 variable resistors
- numpad 4x3
- RFID-RC522 module
Actuator:
- LCD-display
- RGB-led
- servo-motor
- Adafruit MAX98357 I2S Class-D Mono Amplfier
- Waveshare 8Ω 5W Speaker set
More electronics:
- MCP3008
- PCF8574
- different types of resistors
- levelshifter
Case:
- 3x MDF 3 mm 600 x 450mm (you can choose how big you want to make it)
- hinges
- Paint (optional)
Tools:
- laser cutter
- soldering iron
- file
- painting brush
- screwdriver
- glue
Fritzing Schedule
Before we can start making it we need to know how to switch everything. for that we drew an electrical diagram.
This Schedule is utilized during the wiring process of the device and serves as a rapid troubleshooting method in case any connections become loose. Employing this simple procedure can potentially rescue your Raspberry Pi.
Database
We store a lot of data in a database. The stories are kept, every time a code is attempted, it is written to the database. We work with users so that a scoreboard can be made.
To expand it later we work with a table Games, this is linked to the stories, so we can put stories of different games in that table.
Building the Case
I chose to laser cut the housing. I did this with a 3mm thick mdf sheet. You can find the files I made here, the laser cutter I used was 600x450mm. You can adjust the file to the size of your lasercutter. the 6 holes are for the buttons, the buttons I used are 16mm, you can adjust this diameter according to your buttons.
Then you can put it together. i glued it together. If necessary I can put another small support along the inside to make it more solid (see pictures).
The large space along the inside makes it easy to tuck away all your electronics.
The Game
Here is the fully written out version of the game, so you can easily understand the game if you want to recreate it. The script is in dutch, because I made it in dutch.
Downloads
Backend
After all the hardware is connected, you can start with the software. First we need to install some packages. You can install de requirements.txt
pip install -r requirements.txt
You also need packages that are not in the requirements.txt, which you have to install separately:
- Rfid522
- smbus
pip install mfrc522
pip install smbus
In the github, under the folder `backend/helpers/testfiles/` there are files that you can use to start testing each sensor or actuator separately.
After you've tested everything, you can start looking at the app.py. The thread contains all the code to play the game. However, it is executed only when a game is in progress. Only one game can be played at a time. If a game is already in progress, no one else can press the start button.
Frontend
Through app.js, there is communication between the frontend and the backend. You can customize the user interface to what you like. You just have to make sure that all the javascript classes stay as they are.
The story of the escape game keeps changing on the screen. This is done via socketio. Each time a correct move is made on the control panel, an emit is sent to the frontend and then the currentStoryID is updated and thus the new story is retrieved.
backend:
socketio.emit('B2F_juist_antwoord',{'knop': 'juist'})
frontend:
socketio.on('B2F_juist_antwoord', function (jsonobject) {
console.log(jsonobject);
console.log('het antwoord is juist')
clearTimeout(currentAnimation)
let gameid = localStorage.getItem('gameID');
let userid = localStorage.getItem("userID");
handleData(`http://${lanIP}/game/${userid}/${gameid}/`, callbackRedirectGame, showError, 'PUT');
});