• Blog
  • Docs
  • Pricing
  • Weโ€™re hiring!
Log inSign up
biglaz

biglaz

my-first-val

Public
Like
my-first-val
Home
Code
7
untitled-folder-7725
01_script.tsx
H
02_http.tsx
C
03_cron.tsx
E
04_email.tsx
README.md
H
new-file-5574.tsx
Branches
1
Pull requests
Remixes
History
Environment variables
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.
Sign up now
Code
/
README.md
Code
/
README.md
Search
6/2/2025
Viewing readonly version of main branch: v21
View latest version
README.md

๐ŸŽจ Draw & Guess - Multiplayer Game

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.

๐ŸŽฎ How to Play

  1. Create or Join a Room: Enter your name and either create a new room or join an existing one with a room code
  2. Wait for Players: The host can start the game once at least 2 players have joined (up to 8 players)
  3. Take Turns Drawing: Players take turns drawing a randomly assigned word while others guess
  4. Guess and Score: Correct guesses earn points for both the guesser and the drawer
  5. Win the Game: After 3 rounds, the player with the most points wins!

โœจ Features

  • 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

๐Ÿ—๏ธ Project Structure

โ”œโ”€โ”€ 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

๐Ÿ”ง Technical Details

Backend (Hono API)

  • 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)

Frontend (Vanilla JS)

  • 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

Key API Endpoints

  • POST /api/rooms - Create a new game room
  • POST /api/rooms/:id/join - Join an existing room
  • POST /api/rooms/:id/start - Start the game (host only)
  • POST /api/rooms/:id/draw - Submit drawing data
  • POST /api/rooms/:id/guess - Submit a guess
  • GET /api/rooms/:id/drawing - Get current game state

๐ŸŽฏ Game Rules

  • 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

๐Ÿš€ Getting Started

  1. Visit the app URL
  2. Enter your name
  3. Create a new room or join with a room code
  4. Share the room code with friends
  5. Start playing when everyone has joined!

๐Ÿ”ฎ Future Enhancements

  • 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

๐Ÿ› ๏ธ Development

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.

FeaturesVersion controlCode intelligenceCLIMCP
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
Weโ€™re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
ยฉ 2026 Val Town, Inc.