โšก Onwuachi Control Plane

KB-GAME-001 โ€” Adding a New Game to the Platform Arcade

Overview

The platform hosts a small arcade of self-contained, static, client-side games โ€” no database, no backend, pure HTML/CSS/JS served directly through the existing Hugo + HAProxy pipeline. Each game is a single index.html file with everything inlined (no external JS/CSS dependencies), which keeps deployment trivial: drop the file in the right static folder, rebuild Hugo, done.

As of this writing the arcade has 6 games: Test Platformer, Breakout, Snake, Space Shooter, Invaders, and Frogger.

Repo structure

apps/hugo/service/static/games/<game-name>/index.html   โ† the actual game, static asset
apps/hugo/service/content/culture/games/_index.md        โ† archive landing page (card grid)
apps/hugo/service/content/culture/games/<game-name>.md   โ† per-game content page (iframe embed)
apps/hugo/service/static/css/games-grid.css               โ† shared card grid styling

URL mapping:

Important: the static file must be named index.html (not <game-name>.html) inside its own folder, so the clean URL /games/<game-name>/ resolves. Naming it anything else means visitors hit an ugly /games/<game-name>/<game-name>.html URL instead โ€” this has bitten us before (Breakout was initially saved as breakout.html and had to be renamed).

Shared conventions across every game

Every game file follows the same baseline, established across the platformer, Breakout, Snake, the shooter, Invaders, and Frogger builds:

Checklist: adding a new game

  1. Build the game file as a single self-contained index.html, following the shared conventions above (viewport, pause, fullscreen, mobile controls, localStorage best score).
  2. Create the static folder and place the file:
    cd apps/hugo/service/static/games
    mkdir <game-name>
    mv "$DL/<game-name>.html" <game-name>/index.html
    
  3. Test locally โ€” explorer.exe index.html from WSL2 opens it directly via file://, no deploy needed for basic testing. Confirm keyboard controls, mobile touch controls (browser dev tools device emulation is a reasonable proxy but real-device testing has caught bugs emulation missed), pause/resume, and win/lose states.
  4. Create the content page:
    apps/hugo/service/content/culture/games/<game-name>.md
    
    Frontmatter: title, date. Body: one-line description, the iframe embed (src="/games/<game-name>/", remember allow="fullscreen" allowfullscreen), and a Controls: line.
  5. Add a card to the archive index at apps/hugo/service/content/culture/games/_index.md, inside the <div class="games-grid"> block:
    <a href="/culture/games/<game-name>/" class="game-card">
      <div class="game-icon">๐ŸŽฎ</div>
      <p class="game-title">Game Title</p>
      <p class="game-blurb">One-line hook.</p>
      <p class="game-play">Play โ†’</p>
    </a>
    
  6. Deploy:
    ./scripts/deploy-hugo.sh
    
  7. Verify live:
    • /culture/games/ shows the new card
    • /culture/games/<game-name>/ loads the content page with the game embedded
    • /games/<game-name>/ loads the raw game directly
    • Card link, iframe, and controls all work
    • Test on an actual mobile device if possible, not just emulation โ€” several real bugs (landscape sizing, fullscreen support, touch-vs-click event mismatches) only surfaced on real hardware

Known open issues / rough edges

Games built so far

GamePathNotes
Test Platformer/games/platformer/8 levels, double jump, coyote time, character skins
Breakout/games/breakout/Paddle physics, angled bounce based on hit position
Snake/games/snake/Classic grid movement, can’t reverse into self
Space Shooter/games/shooter/Free 8-directional movement, escalating waves
Invaders/games/invaders/Classic marching grid, enemies fire back
Frogger/games/frogger/Road + river crossing, log-riding, countdown timer

System Context

โ† Back to Kb