Documentation
¶
Overview ¶
Package kit is the shellcade game developer kit: the authoring surface for wasm games targeting the shellcade ABI (see ABI.md; the wire package is the ABI's code form).
A game implements Game + Handler and calls Main(game) from main(), plus the eight //go:export trampolines for the wasm build — run `gamekit new` for a working scaffold, and see GUIDE.md for the full authoring guide.
This package is a curated facade over internal/game; the implementation is internal so the public surface stays deliberate and versionable.
Index ¶
- Constants
- Variables
- func Main(g Game)
- type Account
- type AccountStore
- type Action
- type Aggregation
- type Attr
- type Base
- type Cell
- type Color
- type ConfigKeySpec
- type ConfigStore
- type ConfigType
- type Direction
- type Frame
- type Game
- type GameMeta
- type Handler
- type Input
- type InputContext
- type InputKind
- type KVStore
- type Key
- type Kind
- type LeaderboardSpec
- type Lifecycle
- type MergeRule
- type MetricFormat
- type Mode
- type Player
- type PlayerResult
- type Result
- type Room
- type RoomConfig
- type Services
- type Status
- type Style
Constants ¶
const ( KindGuest = game.KindGuest KindMember = game.KindMember InputRune = game.InputRune InputKey = game.InputKey KeyNone = game.KeyNone KeyEnter = game.KeyEnter KeyBackspace = game.KeyBackspace KeyEsc = game.KeyEsc KeyTab = game.KeyTab KeyUp = game.KeyUp KeyDown = game.KeyDown KeyLeft = game.KeyLeft KeyRight = game.KeyRight KeyCtrlC = game.KeyCtrlC CtxCommand = game.CtxCommand CtxText = game.CtxText ActNone = game.ActNone ActUp = game.ActUp ActDown = game.ActDown ActLeft = game.ActLeft ActRight = game.ActRight ActConfirm = game.ActConfirm ActBack = game.ActBack )
const ( ModeQuick = game.ModeQuick ModePrivate = game.ModePrivate ModeSolo = game.ModeSolo MergeKeepWinner = game.MergeKeepWinner MergeKeepLoser = game.MergeKeepLoser MergeSum = game.MergeSum MergeMax = game.MergeMax HigherBetter = game.HigherBetter LowerBetter = game.LowerBetter CtxFeatRosterEpoch = game.CtxFeatRosterEpoch LifecycleResumable = game.LifecycleResumable LifecycleEphemeral = game.LifecycleEphemeral LifecycleResident = game.LifecycleResident ConfigText = game.ConfigText ConfigNumber = game.ConfigNumber ConfigBool = game.ConfigBool ConfigJSON = game.ConfigJSON BestResult = game.BestResult SumResults = game.SumResults Integer = game.Integer Decimal = game.Decimal Duration = game.Duration StatusFinished = game.StatusFinished StatusDNF = game.StatusDNF StatusFlagged = game.StatusFlagged )
const ( Rows = game.Rows Cols = game.Cols AttrBold = game.AttrBold AttrDim = game.AttrDim AttrUnderline = game.AttrUnderline AttrReverse = game.AttrReverse )
const ABIVersion = game.ABIVersion
ABIVersion is the ABI major version this SDK targets.
Variables ¶
var ( White = game.White Red = game.Red Green = game.Green Yellow = game.Yellow Cyan = game.Cyan DimGray = game.DimGray )
Standard palette.
Functions ¶
func Main ¶
func Main(g Game)
Main, built natively, runs the instant inner-loop dev runner: `go run .` plays the game in this terminal with normal Go tooling and zero wasm. Flags: -seed N · -heartbeat 50ms · -config k=v · -seats N · -handle name.
With -smoke <file> [-smoke-out <dir>] it instead runs the smoke script non-interactively and writes the named shot files — see the smoke package and GUIDE.md "Smoke scripts".
Types ¶
type AccountStore ¶
type AccountStore = game.AccountStore
type Action ¶
func Resolve ¶
func Resolve(in Input, ctx InputContext) Action
Resolve maps an Input to a semantic Action for the given context — the platform's canonical control vocabulary, reimplemented locally.
type Aggregation ¶
type Aggregation = game.Aggregation
type ConfigKeySpec ¶
type ConfigKeySpec = game.ConfigKeySpec
type ConfigStore ¶
type ConfigStore = game.ConfigStore
type ConfigType ¶
type ConfigType = game.ConfigType
type InputContext ¶
type InputContext = game.InputContext
type LeaderboardSpec ¶
type LeaderboardSpec = game.LeaderboardSpec
type MetricFormat ¶
type MetricFormat = game.MetricFormat
type PlayerResult ¶
type PlayerResult = game.PlayerResult
type RoomConfig ¶
type RoomConfig = game.RoomConfig
Directories
¶
| Path | Synopsis |
|---|---|
|
Package docs embeds the author-facing getting-started guide so the shellcade arcade can render it directly in its "Add your own game" screen — a glamour-rendered Markdown pane inside an 80x24 SSH TUI.
|
Package docs embeds the author-facing getting-started guide so the shellcade arcade can render it directly in its "Add your own game" screen — a glamour-rendered Markdown pane inside an 80x24 SSH TUI. |
|
internal
|
|
|
diffbench
Package diffbench measures candidate frame-delta wire encodings for the shellcade guest->host frame channel against the current full-frame baseline.
|
Package diffbench measures candidate frame-delta wire encodings for the shellcade guest->host frame channel against the current full-frame baseline. |
|
game
Package kit is the shellcade guest SDK: the authoring surface for wasm games targeting shellcade ABI v2.
|
Package kit is the shellcade guest SDK: the authoring surface for wasm games targeting shellcade ABI v2. |
|
smoke
Package smoke is the engine behind the public smoke package and the dev runner's -smoke mode: it parses a game's smoke.yaml, executes the script deterministically against a native game (virtual clock, seeded RNG), and renders the named shots.
|
Package smoke is the engine behind the public smoke package and the dev runner's -smoke mode: it parses a game's smoke.yaml, executes the script deterministically against a native game (virtual clock, seeded RNG), and renders the named shots. |
|
Package keyhold derives "key held" state from terminal auto-repeat — the closest a terminal game can get to press/release semantics.
|
Package keyhold derives "key held" state from terminal auto-repeat — the closest a terminal game can get to press/release semantics. |
|
Package kittest is an in-memory test double for the kit authoring surface: a Room (plus Services/KV/config) you can drive from plain Go tests, with the sends, posts, and settle recorded for assertions.
|
Package kittest is an in-memory test double for the kit authoring surface: a Room (plus Services/KV/config) you can drive from plain Go tests, with the sends, posts, and settle recorded for assertions. |
|
Package smoke runs a game's smoke.yaml: a small deterministic script (seed, seats, steps) that drives the game on a virtual clock and dumps named 80×24 screens.
|
Package smoke runs a game's smoke.yaml: a small deterministic script (seed, seats, steps) that drives the game on a virtual clock and dumps named 80×24 screens. |
|
Package wire IS the shellcade game ABI as code: the version handshake, the export and host-function names, and the packed little-endian payload encodings, expressed over neutral types with zero dependencies.
|
Package wire IS the shellcade game ABI as code: the version handshake, the export and host-function names, and the packed little-endian payload encodings, expressed over neutral types with zero dependencies. |