Bash.tv → GitHub → itch.io

Create a standard, ready-to-run browser game project in seconds. A plain JavaScript (ES modules, no build step) template with a fixed-step loop, letterboxed scaling, keyboard and touch input by action, audio unlock and mute, safe saves, a scene stack for title / play / pause / game over (victory and defeat), placeholder gameplay that exercises every system, plus README, CREDITS and docs/GDD.md ...

Download skill (.zip) Files on GitHub

Game scaffolding

First: does a Bash kit apply?

Bash spaces can offer game kits (game-kit-2d on Phaser, game-kit-3d on three.js, app-kit for app-like games). If the space’s first message lists a kit and the person picked a game it fits, use the kit, not this template. Kits set up the dev server, preview and Bash features.

Use this template when no kit applies, when the user wants plain JavaScript with no build step, for a quick standalone game that will ship to itch.io or other portals, or to restructure a messy single-file game (see game-refactoring).

Create

python3 <skill>/scripts/scaffold.py <folder> --title "My Game" --pitch "Grab coins, dodge squares." \
  [--width 960 --height 540] [--author yourname]

Start from a genre instead of coins and squares: every genre skill (platformer, space shooter, tower defense, RTS, card game, visual novel, rhythm and 18 more) ships a tested starter in its assets/starter/ folder, and device-orientation-controls has a tilt maze. Add --starter <genre skill>/assets/starter. It copies the template, then replaces src/config.js and src/scenes/play.js and adds helpers such as src/core/touch.js (multi-touch buttons, a stick, pause, end-of-run) and src/core/topdown.js (wall sliding, line of sight, a seeded RNG, a follow camera).

Pick the size from the game: 960×540 for landscape action, 540×960 for portrait or phone-first games, 640×480 for retro. In a Bash space the usual folder is the served app folder (for example www/ for repos that deploy from www/). Then serve it (python3 -m http.server <port> with tmux: true) and open_preview.

What you get

index.html  style.css  README.md  CREDITS.md
src/config.js          every tunable number (sizes, speeds, lives, win condition, save key)
src/main.js            builds the shared `game` object, registers scenes, starts the loop, auto-pauses when hidden
src/core/loop.js       fixed 60 Hz update + render per frame, capped so hitches don't fast-forward
src/core/screen.js     game units → real pixels, letterbox, devicePixelRatio capped at 2, toGame() for input
src/core/input.js      actions (left/right/up/down/confirm/pause) → keys, plus CONFIG.bindings; pointer with tapped,
                       released, startX/startY (for drags and swipes); no page scrolling; device detection
src/core/audio.js      Web Audio, first-tap unlock, mute, synth placeholder sounds, load(name, url) for files
src/core/save.js       try/catch storage with a game-specific prefix
src/core/scenes.js     scene stack: switch / push / pop; top updates, all draw
src/core/draw.js       text, overlay, touch buttons, overlaps()
src/scenes/            title → play ⇄ pause → gameover {result, score, best, time?, scoreLabel?, title?}
src/entities/          player (keys + drag-to-move), coin, enemy
assets/img|sfx|music   empty, ready for files
docs/GDD.md            design doc stub (see game-design-document)
docs/HANDOFF.md        session handoff stub (see game-session-handoff)

window.__game exposes the game for debugging and tests, for example __game.scenes.current.

Rules when building on it

Check it works

Load it in the preview, then go through title → play → pause → resume → lose → play again, and test on a phone viewport. For automated checks in the sandbox browser (2D canvas only): playwright-cli eval "window.__game.scenes.current".