Build from scratch
For anyone who are more technical and want to have a full control over the game, this is your guide.
1. Install the hugame CLI
Install Node.js 22 or later if you do not have it. Then install the hugame CLI with npm.
npm install -g hugame
Run hugame --help for the commands supported by your installed version. The
command reference
documents the complete workflow.
Writing the game
A Hugame game is a simple HTML page with a manifest file: hugame.json.
Basically, it’s a folder containing:
hugame.json
index.html
cover.png exactly one of cover.png or cover.webp
assets/ optional
scripts/ optional
styles/ optional
Use hugame init to create a starter project, you’re free to use any web technologies
to build the game.
You can read the full package spec on GitHub.
When hosting the game on hugame.dev, a runtime bridge will be injected to the game, so your game can interact with the platform for keeping the game state or reporting user scores.
window.Hugame?.score(12);
const saved = await Hugame.progress.load();
// { data: null | object, schemaVersion, revision, storage }
if (saved.data) restoreGame(saved.data, saved.schemaVersion);
const result = await Hugame.progress.save(
{ level: 3, checkpoint: "castle-entrance", coins: 82 },
{ schemaVersion: 1 },
);
The full runtime spec is also on GitHub.
You can test your game live with the hugame API locally, simply run hugame dev. A local
debugging page will be open with the hugame runtime enabled.
Uploading & Contributing
Finally, after you finished your game, run hugame pack to pack and validate your game.
Then run hugame upload or upload from the web UI.
The hugame package spec and runtime is very minimal and there are a lot of features to be added. Please join our community on hugame-kit to suggest or implement new features.