ship

command
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 7, 2026 License: MIT Imports: 4 Imported by: 0

README

# Ship (built to be published, and it is)

demo

Play it in your browser on itch.io: this exact code, built to WebAssembly and uploaded per the guide.

A small dodge game whose point is the shipping pipeline: assets are embedded in the binary, the window is resizable, F toggles fullscreen, and PUBLISHING.md uses this example for the single-exe and browser builds.

A/D or arrow keys to dodge the comets. Survive as long as you can.

cd examples/ship
go run .

Ship it

# One self-contained exe, no console window:
go build -ldflags "-s -w -H=windowsgui" -o ship.exe .

# Browser build for itch.io:
$env:GOOS="js"; $env:GOARCH="wasm"
go build -o web/game.wasm .
$env:GOOS=$null; $env:GOARCH=$null

See PUBLISHING.md for the index.html, the itch.io upload flow, and generating THIRD-PARTY-NOTICES.txt.

What this example proves

  • engine.UseAssets(content) with //go:embed sprites audios: the same asset paths work from disk in development and from inside the binary when shipped.
  • g.Resizable(true), g.Fullscreen(bool) toggled from a key, and g.Icon(...) for the title bar.
  • The whole publishing story is this file plus two build commands.

Documentation

Overview

Ship: a small dodge game built to be PUBLISHED. Pixel-art sprites, an animated thruster, an explosion, a starfield, a real menu with drawn buttons, and the Press Start 2P pixel font (OFL licensed, see fonts/OFL.txt). Assets are embedded: the binary ships alone.

A/D or arrows to dodge. F toggles fullscreen.

Run: cd examples/ship && go run . Ship: see PUBLISHING.md at the repo root.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL