Skip to content
Back to skills

Share The Game

ASecurity

`{{pmRunDev}}` runs the game on your own computer while you make it. To let other people play, you make a "production build" - a folder of plain files - and upload that folder to a free hosting site. The game is just files, so there is no server or database to set up.

  • 17 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added November 7, 2026
developmentjavascriptjavagitapidatabase

Works with

  • cli
  • api

Security analysis

A100/100

Scanned November 24, 2026

npx -y skills add blit386/blit386 --skill share-the-game --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Share The Game?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Share The Game
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/blit386-share-the-game/badge)](https://www.skillsdirectory.com/skills/blit386-share-the-game)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: share-the-game
description:
  Build the finished game into a folder of plain files and put it online so other people can play. Use when the user
  wants to publish, deploy, or host the game, send a playable link to a friend, or asks 'how do I share my game', 'put
  my game on the internet', or 'make a real version people can play'.
---

# Share the game

`{{pmRunDev}}` runs the game on your own computer while you make it. To let other people play, you make a "production
build" - a folder of plain files - and upload that folder to a free hosting site. The game is just files, so there is no
server or database to set up.

## Step 1: build the game

```sh
{{pmRunBuild}}
```

This writes a `dist/` folder. Everything the game needs is inside it: the HTML page, the JavaScript, and your sprites
and fonts. That whole folder _is_ the game.

## Step 2: try the built game before sharing

The built game can behave a little differently from the dev server, so test it once first. Your project has a `preview`
script for this - run it the same way you run `dev` and `build` (for example `pnpm run preview` or `npm run preview`).
It serves the `dist/` folder at a local web address so you can click around and confirm everything still works.

## Step 3: put dist/ online

Upload the whole `dist/` folder to any free static host - it accepts plain files, no server needed. Each one gives you
back a web address you can share.

- Netlify and Cloudflare Pages put the game at the top of its own address (`my-game.netlify.app/`). The build works
  there as it is.
- GitHub Pages (`you.github.io/my-game/`) and itch.io put it in a folder inside a bigger site. A default build loads
  nothing there - a blank page - until you make the two changes below and build again.

### Before uploading to GitHub Pages or itch.io

1. In `vite.config.js`, add `base: './'` so the built page loads its files from the folder it sits in, not from the top
   of the website:

   ```js
   export default defineConfig({
     base: './',
     plugins: [blit386()],
   });
   ```

2. Write the paths to your own files without a leading slash: `'sprites/hero.png'`, not `'/sprites/hero.png'`. A path
   that starts with `/` always means the top of the website, and `base` does not change the paths you type in your code.
   Paths without the slash work in `{{pmRunDev}}` too.

## Notes

- The game runs on WebGPU where it is available and falls back to plain Canvas 2D everywhere else, so friends can play
  in any modern browser with nothing extra installed. (Only fullscreen CRT or post-process effects need WebGPU - see the
  add-crt-effect skill.)
- Has sound? Expect the shared game to be silent until the player clicks, taps, or presses a key. Browsers refuse to
  make noise on a page nobody has touched yet, so this is not a broken upload. Give the game a "press a key to start"
  screen and the sound arrives with the first keypress. See the play-a-sound skill.
- Played on a phone? Mobile browsers dim and then lock the screen after 30-60 seconds of no touches, even mid-game. Set
  `isWakeLockEnabled: true` in `configure()` to keep the screen awake during active play. Landscape-only games can also
  set `preferredOrientation: 'landscape'` (Android may lock; iOS will not) and read `BT.screenOrientation` or implement
  `onOrientationChange(type)` to show a "please rotate" prompt. See the blit-api-names rule for the exact names.
- Made a change you want to share? Run `{{pmRunBuild}}` again and re-upload `dist/`. The build does not update itself.
- Chose the GitHub CI workflow when you made the game? It builds the game and checks formatting on every push, but it
  never uploads anything. Putting `dist/` online stays the step above.
- Do not hand-edit files inside `dist/` - they are generated from your `src/` code. Change the source, then rebuild.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.