EN /HU | Login

Ebitengine

Ebitengine (formerly Ebiten) is a fast and portable 2D game engine for Go.

Website: https://ebitengine.org Projects built with this engine: Rabbit Roller


Makefile

Go compiles to a native binary or to WebAssembly. The web build needs three files: game.wasm, wasm_exec.js and index.html.

Variables

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

Targets

SH
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/

VS Code

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.

Generated artifacts

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)

Requirements

Local only: make, go 1.11+, curl, zip, and fswatch for watch mode. CI images bring their own tools.


Pipeline

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:

YAML
# .woodpecker.yaml
platform: ebitengine
  • metadata.json
  • the application_token Woodpecker secret: a WarpEngine ApplicationToken with update + upload scopes
  • name: <software> in the marker only when the software name differs from the repo name

Builder images come from the update server's ci_platforms config. Preview the served pipeline:

SH
curl "https://teletypegames.org/build/config?platform=ebitengine"

Steps

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

Result

A versioned web build plus Windows and Linux binaries, uploaded and published. The public game index updates itself.