A real-time reaction game with Arduino integration, featuring single-player and multiplayer modes.
Completed as a hackathon project (ReactCore on Devpost), demonstrating real-time hardware-software integration, multiplayer networking, and adaptive AI.
- Real-time gameplay using Socket.IO
- Arduino integration for physical interaction
- Single-player and multiplayer modes
- Leaderboard with MySQL database integration
- Responsive web interface
- Adaptive rule-based AI opponent for single-player
- Node.js
- Express.js
- Socket.IO
- MySQL
- Arduino
- Node.js (v14+ recommended)
- MySQL server
- Arduino IDE
- Arduino Mega 2560 board
git clone https://github.com/yourusername/reaction-game.git
cd reaction-gamenpm install express socket.io serialport mysql2 cors dotenvDB_HOST=your_host
DB_USER=your_username
DB_PASSWORD=your_password
DB_DATABASE=your_databaseSet up your MySQL database using database_schema.sql.
-
Start Server:
node server.js
-
Open
http://localhost:8000in your web browser.
Run this code on an Arduino Mega 2560 board in the Arduino IDE
Here is a list of the events on the hardware:
- Waiting for game mode selection: RGB lights up cyan, and red, yellow and green LEDs light up
- Game mode selected: RGB lights up magenta
- Game counts down: Red, yellow and green LED lights up one by one
- Game is ready: White LED lights up, a sound cue will indicate the start of the game
- Game ends: RGB lights up blue
The leaderboard displays the top 10 reaction times. It updates in real-time as new scores are added.