Public
Like
my-first-val
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data โ all from the browser, and deployed in milliseconds.
Viewing readonly version of main branch: v21View latest version
A real-time multiplayer drawing and guessing game where friends can join the same room and take turns drawing while others guess what's being drawn.
- Create or Join a Room: Enter your name and either create a new room or join an existing one with a room code
- Wait for Players: The host can start the game once at least 2 players have joined (up to 8 players)
- Take Turns Drawing: Players take turns drawing a randomly assigned word while others guess
- Guess and Score: Correct guesses earn points for both the guesser and the drawer
- Win the Game: After 3 rounds, the player with the most points wins!
- Real-time Drawing: Canvas-based drawing with color and brush size controls
- Live Guessing: Real-time chat for guesses with instant feedback
- Scoring System: Points awarded for correct guesses and successful drawings
- Room Management: Easy room creation and joining with shareable codes
- Mobile Friendly: Touch support for drawing on mobile devices
- Game Controls: Host can start, reset, and manage the game
โโโ backend/
โ โโโ index.ts # Main Hono server with game logic and API
โโโ frontend/
โ โโโ index.html # Main game interface
โ โโโ index.js # Client-side game logic and UI
โโโ README.md # This file
- Room Management: Create and join game rooms with unique codes
- Game State: Track players, rounds, scores, and drawing data
- Real-time Updates: Polling-based updates for game state synchronization
- Drawing Sync: Canvas data synchronization between players
- SQLite Storage: Persistent storage for rooms and players (optional)
- Canvas Drawing: HTML5 Canvas with mouse and touch support
- Real-time UI: Live updates for players, scores, and guesses
- Responsive Design: TailwindCSS for mobile-friendly interface
- Game Flow: Complete game lifecycle from lobby to game over
POST /api/rooms- Create a new game roomPOST /api/rooms/:id/join- Join an existing roomPOST /api/rooms/:id/start- Start the game (host only)POST /api/rooms/:id/draw- Submit drawing dataPOST /api/rooms/:id/guess- Submit a guessGET /api/rooms/:id/drawing- Get current game state
- Players: 2-8 players per room
- Rounds: 3 rounds total, each player draws once
- Scoring:
- Correct guess: +10 points to guesser
- Successful drawing: +5 points to drawer (when someone guesses correctly)
- Words: Random selection from a curated list of drawable words
- Time: No time limit, but games auto-cleanup after 2 hours of inactivity
- Visit the app URL
- Enter your name
- Create a new room or join with a room code
- Share the room code with friends
- Start playing when everyone has joined!
- Timer for drawing rounds
- Custom word lists
- Private rooms with passwords
- Spectator mode
- Drawing replay feature
- More drawing tools (shapes, text)
- Voice chat integration
- Tournament mode
The app uses:
- Hono for the backend API framework
- SQLite for data persistence
- HTML5 Canvas for drawing functionality
- TailwindCSS for styling
- Vanilla JavaScript for client-side logic
All code is written in TypeScript and follows Val Town best practices for serverless deployment.