Introduction Concept: The Crypto Locker Puzzle is an interactive project designed to challenge users with a series of code-cracking tasks under time constraints. The objective is to solve hints and enter correct codes using a custom-built interface to unlock a wooden box and win the prize inside. This game combines physical computing with digital elements to create an engaging and educational experience.
Objective: The main goal of this project is to engage users in a fun and educational way by combining elements of cryptography and puzzle-solving. The game encourages critical thinking and problem-solving skills as players attempt to unlock the box within a specified time limit, providing an enjoyable and challenging experience.
Key Features
1) Dynamic Countdown Timer: A prominently displayed timer adds a sense of urgency and excitement to the gameplay. It counts down from a set time, pushing players to think and act quickly, which enhances the challenge and engagement of the puzzle.
2) Attempt Counter: This feature tracks the number of attempts a user makes to solve the puzzle. It’s great for adding a competitive edge, as players can challenge themselves or others to solve the puzzle in fewer attempts, promoting replayability.
3) Cryptic Hints Display: As players progress, cryptic hints are displayed on the screen to aid in decoding the puzzle. This feature helps to balance the difficulty level and ensures that the puzzle remains solvable while still challenging.
4) Thematic Interface Design: The interface’s design is sleek and modern, resembling a spy gadget, which aligns well with the thematic elements of the puzzle box. This integration of theme and function helps to immerse players in the game’s world.
5) Feedback on Input Accuracy: When players enter a code, the interface immediately provides feedback. If the code is incorrect, players are prompted to try again, and if correct, a success message is displayed, and the box unlocks. This immediate feedback loop keeps players engaged and informed.
6) Multiple Difficulty Levels: With the inclusion of three difficulty levels, the game can cater to a broad range of skill levels. Beginners can start with simpler, shorter codes and fewer hints, while advancing – the game takes the user tackle longer codes with cryptic hints.
Components
- Arduino Uno: Serves as the main controller for input and output operations.
- Servo Motor: Operates the locking mechanism of the box.
- Potentiometer: Allows users to select digits for the code.
- Button: Used for entering selected digits and navigating through the game.
- P5.js: It acts like a digital interface that provides instructions, feedback, and manages the timer and attempt counter.
P5.js Sketch: The P5.js sketch handles the game logic and user interface. It displays hints, the countdown timer, and the number of attempts. It also receives digit inputs from the Arduino and checks them against the predetermined code. If the code is correct, it sends a command to unlock the box.
Arduino Sketch: The Arduino controls the hardware aspects of the project. It uses a servo motor to lock and unlock the box. A potentiometer is used for dialing in digits (0-9), and a button confirms the entry of each digit. The Arduino sends these inputs to the P5.js program, which processes them to determine if the entered code matches the required one.
How the Game Works
-
- Initialization: At the start of the game, the servo motor locks the box, and the Arduino awaits input from the potentiometer and button.
- User Interaction: Players turn the potentiometer to select digits and press the button to confirm each entry. The Arduino sends these inputs to the P5.js sketch.
- Feedback and Unlocking: The P5.js sketch evaluates the entered code. If incorrect, it prompts the user to try again; if correct, it sends a signal to unlock the box via the servo motor.
- Time and Attempts Management: The game includes a countdown timer and records the number of attempts. Players must solve the puzzle before the time runs out.