A Chinese-language web-based party game inspired by the board game "Wavelength". Play with friends online or challenge yourself in single-player mode!
Live Demo: wavelength-game.netlify.app
Wavelength is a social guessing game where players try to read each other's minds. One player gives a clue based on a spectrum (like "hot" to "cold"), and the other player guesses where on that spectrum the clue falls.
- ๐ฒ Multiplayer Mode: Create rooms and play with friends remotely
- ๐ง Single-Player Mode: Challenge yourself against AI creators
- ๐ Bilingual Support: Switch between Chinese and English
- ๐จ Multiple Creators: Each with unique question styles
- ๐ฌ Player-Generated Content: Create and share your own questions
- ๐ Interactive Feedback: Visual and audio effects for perfect hits
Wavelength/
โโโ public/ # Deployable files
โ โโโ index.html # Multiplayer mode
โ โโโ singleplayer.html # Single-player mode
โ โโโ assets/
โ โ โโโ audio/ # Sound effects (partypop.mp3, tick.mp3)
โ โ โโโ images/ # Images (loading.gif)
โ โ โโโ fonts/ # Custom fonts
โ โโโ data/
โ โโโ question_bank.json # Single-player questions
โ โโโ wordbank.json # Word bank for hints
โ
โโโ src/ # Source code
โ โโโ js/
โ โ โโโ multiplayer.js # Multiplayer game logic
โ โ โโโ singleplayer.js # Single-player game logic
โ โ โโโ lang.js # i18n translations
โ โโโ css/
โ โโโ style.css # Styles
โ
โโโ docs/ # Documentation
โ โโโ en/ # English docs
โ โโโ zh/ # Chinese docs
โ
โโโ .env.example # Firebase config template
โโโ .gitignore # Git ignore rules
โโโ package.json # Project metadata
โโโ README.md # This file
- A modern web browser (Chrome, Firefox, Safari, Edge)
- Internet connection (for Firebase and CDN resources)
-
Clone the repository
git clone <your-repo-url> cd Wavelength
-
Serve the files
Using Python:
python -m http.server 8080
Using Node.js (http-server):
npm start
-
Open in browser
http://localhost:8080/public/index.html
The project is a static website and can be deployed to any static hosting service:
- Netlify (current deployment)
- Vercel
- GitHub Pages
- Firebase Hosting
For Netlify, set the publish directory to public/.
- Host: Click "ๅๅปบๆฟ้ด" (Create Room) and share the room number
- Guest: Enter the room number and click "ๅ ๅ ฅ" (Join)
- Take Turns:
- One player sees the spectrum and gives a hint
- The other player guesses where on the spectrum the hint falls
- Score: Try to land in the green zone for points!
- Choose a creator (Sean, Charles, Brus) or play player-created questions
- Read the question and the spectrum endpoints
- Guess where the answer falls on the spectrum
- Get instant feedback and try to improve your guessing skills!
- Frontend: Pure HTML, CSS, JavaScript (no frameworks)
- Backend: Firebase Realtime Database
- Styling: Custom CSS with gradients and animations
- Fonts:
- Google Fonts (Noto Sans SC, ZCOOL XiaoWei)
- Custom fonts (Source Han Sans CN, Zaio)
- Libraries:
- Firebase SDK 8.10.0
- Canvas Confetti 1.6.0
The project uses Firebase for:
- Real-time multiplayer synchronization
- Storing player-created questions
- Game analytics
To use your own Firebase:
- Create a Firebase project at console.firebase.google.com
- Copy
.env.exampleto.env - Update the Firebase config in:
src/js/multiplayer.jssrc/js/singleplayer.js
The easiest way to manage questions is using the built-in visual editor:
- Open
http://localhost:8080/public/question-editor.html - Add, edit, or delete questions with a user-friendly interface
- Export the updated JSON file
- Replace
public/data/question_bank.json
Features:
- โ๏ธ Visual form for adding/editing questions
- ๐จ Color-coded topic pairs
- ๐ Interactive position slider
- ๐ Search and filter by creator
- ๐พ Export/import JSON with one click
See docs/en/QUESTION_EDITOR_GUIDE.md for detailed instructions.
Alternatively, edit public/data/question_bank.json directly:
{
"id": "unique_id",
"topic_pair": "ๅทฆ็ซฏ็น โ ๅณ็ซฏ็น",
"target_position": 45,
"question_text": "ไฝ ็้ฎ้ข"
}Edit public/data/wordbank.json:
{
"words": [
"ๆฐ่ฏ1",
"ๆฐ่ฏ2",
"ๆฐ่ฏ3"
]
}Edit public/data/hintlist.json:
{
"hints": [
{
"left": "ๅท",
"right": "็ญ",
"category": "ๅฝขๆไธ็นๅพ"
}
]
}- Large Font File: Source Han Sans CN font is 8MB. Consider subsetting or using WOFF2 format
- Exposed Firebase Credentials: Implement Firebase Security Rules for production
- No Build Process: No minification or bundling. Consider adding Vite or webpack for optimization
- Total Size: ~16MB (8MB is the Chinese font)
- Load Time: 2-4 seconds on fast connections
- Code Size: ~2,800 lines of JavaScript
Contributions are welcome! Areas for improvement:
- Optimize font files (subset, WOFF2 conversion)
- Add build process for minification
- Implement proper environment variable handling
- Add more question creators
- Improve mobile responsiveness
- Add sound effect toggles
- Implement leaderboards
MIT License - feel free to use this project for your own purposes!
- Inspired by the board game "Wavelength" by Cmyk Games
- Thanks to all players who contributed questions
- Built with โค๏ธ for friends and family
For questions, issues, or suggestions, please open an issue on GitHub.
Have fun playing Wavelength! ๐