File size: 2,576 Bytes
806f43a
 
 
 
 
 
 
fbf0f7b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
806f43a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
---
title: Drawable
sdk: docker
emoji: ๐Ÿš€
colorFrom: blue
colorTo: pink
---
# ๐ŸŽจ Drawable

> The ultimate Draw & Guess game โ€” skribbl.io clone with superpowers.

## ๐Ÿš€ Features (beyond skribbl.io)

| Feature | Drawable | skribbl.io |
|---|---|---|
| Power-ups (Reveal, Time Warp, Bomb) | โœ… | โŒ |
| Emoji reactions (floating) | โœ… | โŒ |
| Drawing replay after each round | โœ… | โŒ |
| Live score graph timeline | โœ… | โŒ |
| Team mode (Red vs Blue) | โœ… | โŒ |
| Sudden Death (wrong = lose points) | โœ… | โŒ |
| Quick Draw mode (20s) | โœ… | โŒ |
| 10 word categories | โœ… | โŒ |
| Custom words | โœ… | โœ… |
| Achievements system | โœ… | โŒ |
| Streak bonuses | โœ… | โŒ |
| Host kick player | โœ… | โœ… |
| Spectator mode | โœ… | โŒ |
| Undo stroke | โœ… | โŒ |
| Shape tools (line, rect, circle) | โœ… | โŒ |
| Bucket fill tool | โœ… | โœ… |
| Close-guess detection | โœ… | โŒ |

## ๐Ÿ“ File Structure

```
drawable/
โ”œโ”€โ”€ server.js          # Node.js + Socket.IO backend
โ”œโ”€โ”€ words.js           # 300+ words across 10 categories
โ”œโ”€โ”€ package.json
โ”œโ”€โ”€ Dockerfile
โ”œโ”€โ”€ .dockerignore
โ””โ”€โ”€ public/
    โ”œโ”€โ”€ index.html     # Lobby
    โ”œโ”€โ”€ game.html      # Game screen
    โ”œโ”€โ”€ css/style.css
    โ””โ”€โ”€ js/
        โ”œโ”€โ”€ lobby.js
        โ””โ”€โ”€ game.js
```

## ๐Ÿ  Run Locally

```bash
npm install
npm start
# Open http://localhost:7860
```

## ๐Ÿค— Deploy to Hugging Face Spaces

1. Go to https://huggingface.co/new-space
2. Name: `drawable` | SDK: **Docker** | Visibility: Public
3. Clone the Space repo:
   ```bash
   git clone https://huggingface.co/spaces/YOUR_USERNAME/drawable
   ```
4. Copy all project files into the cloned folder
5. Push:
   ```bash
   git add . && git commit -m "init" && git push
   ```
6. Wait ~2 min for build. Your game is live! ๐ŸŽ‰

> **Note:** Hugging Face Spaces expose port 7860 automatically โ€” no config needed.

## โ“ Do I need a database?

**No!** All game state is stored in-memory on the server.  
- Rooms exist while players are connected  
- Scores reset each game  
- No user accounts needed โ€” just pick a name and play  

If you want persistent leaderboards later, add Supabase (free tier) and a `/leaderboard` endpoint.

## ๐ŸŽฎ How Rooms Work

```
Player โ†’ click "Quick Play"
  Server: any open room? โ†’ YES โ†’ join it
                         โ†’ NO  โ†’ create new room, wait for others

Player โ†’ click "Create Room" โ†’ get 6-char code โ†’ share with friends
Player โ†’ click "Join Room"   โ†’ enter code โ†’ join instantly
```