Ebitengine (formerly Ebiten) is a fast and portable 2D game engine for Go.
Website: https://ebitengine.org Projects built with this engine: Rabbit Roller
Go compiles to a native binary or to WebAssembly. The web build needs three files: game.wasm, wasm_exec.js and index.html.
| Variable | Description | Default |
|---|---|---|
PROJECT |
Name used in output filenames | ebitenginedemo |
BIN_DIR |
Native executable | bin |
DIST_DIR |
WASM and packaged artifacts | dist |
WASM_NAME |
WebAssembly filename | game.wasm |
VERSION_FILE |
Version file for CI | .version |
INDEX_HTML_URL |
index.html template | ebitengine-tools repo |
make build # go build -> bin/<PROJECT> for the current OS
make wasm # dist/game.wasm + wasm_exec.js
make export VERSION=1.0.0 # wasm + index.html zipped as ebitenginedemo-1.0.0.html.zip
make watch # rebuild the native binary on change in . (needs fswatch)
make clean # remove bin/ and dist/
Copy example-tasks.json to .vscode/tasks.json and replace ebitenginedemo with your PROJECT. Tasks: Run (default, Cmd+Shift+B), Build & Run, Build WASM, Make build.
| File | Description |
|---|---|
bin/ebitenginedemo |
Native executable, current OS |
dist/game.wasm |
WebAssembly binary |
dist/wasm_exec.js |
Go WASM runtime helper |
ebitenginedemo-<version>.html.zip |
Web build (index.html + WASM + runtime) |
Local only: make, go 1.11+, curl, zip, and fswatch for watch mode. CI images bring their own tools.
The pipeline is not in the game repo. Woodpecker asks the update server, and WarpEngine serves the whole config from /build/config (template lib/warp_engine/ci_templates/ebitengine.yaml.erb).
The repo needs three things:
# .woodpecker.yaml
platform: ebitengine
metadata.jsonapplication_token Woodpecker secret: a WarpEngine ApplicationToken with update + upload scopesname: <software> in the marker only when the software name differs from the repo nameBuilder images come from the update server's ci_platforms config. Preview the served pipeline:
curl "https://teletypegames.org/build/config?platform=ebitengine"
| Step | What it does |
|---|---|
| 1. version | read the version from metadata.json, else the git short hash; outside main/master prefix it as dev-<version>-<branch> |
| 2. build | GOOS=js GOARCH=wasm, add wasm_exec.js and index.html, zip them |
| 3. binaries | cross-compile win-x86, win-x64, linux-x64, one versioned zip each |
| 4. artifact | copy metadata.json to its versioned name, then POST /build/upload with the X-Update-Secret header |
| 5. publish | POST /build/publish?platform=ebitengine |
A versioned web build plus Windows and Linux binaries, uploaded and published. The public game index updates itself.