Tutorial · ~10 min · Any AI agent

Build a multiplayer game
with one prompt

Paste a prompt into your AI coding agent. It builds a real-time drawing game, exposes it to the internet with HLE, and gives you a URL to share. Your friend clicks, logs in, and you're playing.

Get Your API Key →
🎨

A drawing game

Pictionary-style multiplayer. One player draws, others guess. Real-time canvas over WebSocket.

🔗

A shareable URL

Your laptop becomes the server. HLE gives it a public https:// URL.

🔒

SSO login gate

Your friend logs in with Google or GitHub. No accounts to create, no passwords to share.

Before you start

The Prompt

Copy this and paste it into your AI agent. It handles everything — writing the game, installing dependencies, starting the server, exposing it to the internet, and creating a reusable start script.

prompt.txt
I want to build a multiplayer real-time drawing game and share it with a friend over the internet. Please do everything for me: ## Step 1: Create the game Create a single file called `game.py` that: - Uses Python's `websockets` library (version 13.x) as the server on port 8765 - Serves the game HTML page on HTTP GET requests and handles WebSocket connections on the same port (all inline, no separate files) - Implements a Pictionary-style drawing game: - Players open http://localhost:8765 in a browser and enter a nickname - The first player in each round is the "drawer" — they see a secret word - Everyone else is a "guesser" and sees the drawing appear in real time on a canvas - Drawing strokes (x, y, color, size) are broadcast via WebSocket to all players - Guessers type answers into a chat input — correct guess scores a point and starts a new round - Rounds auto-rotate every 60 seconds if nobody guesses correctly - Include a built-in word list of 40+ common nouns (animals, food, objects, sports) - Show a live scoreboard and a player list - Give the drawer a color picker and brush size slider - Make it look good — use a dark theme, clean layout, rounded corners ## Step 2: Install dependencies Run: ``` uv venv && source .venv/bin/activate uv pip install 'websockets>=13,<14' hle-client ``` ## Step 3: Start the game server Run `python game.py` in the background. Verify it starts on port 8765 without errors. Quick self-check: `curl -s http://localhost:8765 | head -1` should return `<!DOCTYPE html>`. ## Step 4: Expose it to the internet with HLE Before running this step, ask me for my HLE API key. I'll get one from https://hle.world/dashboard/keys (register first if needed, then create an API key). Once I give you the key, run: ``` hle expose --service http://localhost:8765 --label game --api-key <the key I give you> ``` Wait for the tunnel URL to appear (it will look like https://game-xxx.hle.world). Show me the tunnel URL. ## Step 5: Create a start script Create `start.sh` that: 1. Activates the .venv virtual environment 2. Starts `game.py` in the background 3. Waits 2 seconds for it to boot 4. Runs the hle expose command 5. Prints the tunnel URL when ready 6. Stops the game server cleanly on Ctrl+C Make `start.sh` executable with `chmod +x start.sh`. ## Done Tell me the tunnel URL so I can send it to a friend. Confirm that start.sh was created so I can run the game again later with a single command.
What does this prompt actually do?
  • Generates a complete multiplayer drawing game as a single Python file (~200-300 lines)
  • Creates a virtual environment and installs two packages: websockets (v13) for the game server and hle-client to create the tunnel
  • Starts the game on your machine — nothing leaves your laptop except through HLE
  • Creates an encrypted tunnel via HLE — your game gets a public URL with HTTPS and SSO
  • Writes a start script so next time you just run ./start.sh

Tips for your agent

The prompt works with any AI coding agent. Here's what to expect from each:

Fully auto Claude Code

Claude Code runs commands directly in your terminal. Paste the prompt and it will create the file, install packages, start the server, and run HLE — all automatically.

When Claude asks "Should I run this command?", say yes to each step. The whole thing takes about 2 minutes.

If the session gets interrupted, resume with claude --continue.

Semi-auto Gemini CLI / Aider / Amp

These agents generate code and can often run commands, but may need a nudge. After the agent creates game.py, you might need to run the remaining steps yourself:

uv venv && source .venv/bin/activate
uv pip install 'websockets>=13,<14' hle-client
python game.py &
hle expose --service http://localhost:8765 --label game --api-key YOUR_KEY

Then ask the agent to create start.sh as a follow-up.

Code + terminal GitHub Copilot / Cursor / Windsurf

IDE-based agents will generate game.py in your editor. After the file is created, open a terminal:

uv venv && source .venv/bin/activate
uv pip install 'websockets>=13,<14' hle-client
python game.py

Then in a second terminal:

source .venv/bin/activate
hle expose --service http://localhost:8765 --label game --api-key YOUR_KEY

Paste the "Create a start script" section as a follow-up prompt to get start.sh.

What happens next

Once you paste the prompt, your agent works through these steps:

  1. Agent writes game.py A single Python file with the full multiplayer drawing game — canvas, WebSocket server, word list, scoreboard, and a dark-themed UI. All HTML/CSS/JS is served inline.
  2. Installs dependencies Creates a venv, installs websockets and hle-client. That's it.
  3. Starts the game server Your game is now running locally on localhost:8765. You can already open it in your browser to test.
  4. Exposes it with HLE Runs hle expose --service http://localhost:8765 --label game — creates an encrypted tunnel from your laptop to the internet.
  5. Your tunnel URL appears Something like https://game-x7k.hle.world — a real HTTPS URL anyone can visit, backed by your laptop.
  6. Start script is created Next time, just run ./start.sh — one command to start the game and tunnel together.

Now text your friend

Hey, wanna play a game I just made? https://game-x7k.hle.world Just now
lol sure Just now

They click the link. HLE's login gate asks them to sign in with Google or GitHub — one click, no account creation. Then they're in the game, seeing your drawing appear stroke by stroke.

That's the whole thing. Your laptop is the server. HLE is the tunnel. Your AI agent wrote the code.

How HLE makes this work

Your laptop
game.py
HLE Relay
Encrypted tunnel
Your friend
Browser

Your game runs entirely on your machine — nothing is uploaded anywhere. HLE creates a WebSocket tunnel between your laptop and its relay server. When your friend visits the URL, their traffic flows through the tunnel to your local game server and back.

The connection is encrypted end-to-end. The SSO gate means only people who log in can reach your game. And because HLE natively proxies WebSocket traffic, the real-time drawing strokes flow smoothly in both directions.

Learn more about how HLE works →

Ready to build?

Create a free HLE account, grab your API key, and paste the prompt.