hello-eme-play
Game engine that turns any website into a game, configured by a single JSON. With a plugin for Payload CMS.
AI-generated- Tools
What it's about
On hello-eme.ch a small pixel figure walks across the page, punches paragraphs until they break and gets into a car. That bit of fun grew into an engine of its own: the website itself is the playing field, and everything that happens in the game lives in a single JSON. That way the game fits on any page, with plain HTML, any framework or any CMS.
Try it
On hello-eme.ch, press the game button next to the light/dark switch. For your own page one line is enough: download play.js from the releases page, put it next to your page and include it.
<script src="/play.js" data-config="{}" defer></script> {} is already a complete game with all defaults. Everything else is merged over those defaults.
What the engine can do
- Two views: top-down and side-scroller, where the page's elements become platforms. Switch at any time through items, triggers or levels
- Figure, monsters, vehicles with stats like health, attack and speed, moves (punch, kick, bite) and behaviors (chase, wander, flee)
- Levels and goals: score, kills, survive for a while or defeat a boss
- Items, upgrades, a shop and triggers following the pattern “when X happens and Y holds, do Z”, plus sounds and a high score
- Your own pictures: pixel art is built in, your own PNG or SVG sprites with animations replace it
- Touch controls with a d-pad, round action buttons and a steering wheel and pedals for the car
- Safe: the JSON is always validated, wrong values are corrected and never crash the page
Screenshots
Edit it in the CMS
For Payload CMS there is a plugin. It turns the JSON schema into a form in the admin, in German or English, with presets, a picture picker and a tab for the raw JSON. That's how I adjust the game on hello-eme.ch without touching code.
Balance without a browser
Bots play a JSON headless and report win and death rates, scores and hints such as “nobody survives” or “too easy”.
Tech
TypeScript in an Nx monorepo with five packages: play (browser runtime), play-core (game logic without a DOM), play-schema (defaults, validation, migrations, JSON Schema), play-payload (the plugin) and play-sim (the bots). Installed straight from the GitHub releases, no npm account or token needed. Open source under the MIT license.
Like hello-eme-play? Buy me a coffee.