host

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2026 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

Package host is the program that runs one game: it reads commands on one stream, writes frames on another and paces the engine at its own frame rate. cmd/wittyplay-game-runner wraps it in a process; tests run it directly.

Index

Constants

View Source
const StampBits = 32

StampBits is how many cells the strip has.

Variables

View Source
var StampColours = [][3]byte{{255, 0, 0}, {0, 255, 0}, {0, 0, 255}, {255, 255, 0}, {0, 255, 255}, {255, 0, 255}, {128, 128, 128}, {64, 128, 192}, {192, 96, 48}}

StampColours are the colours drawn, red, green and blue. web/latency.ts has them too.

Functions

func Run

func Run(in io.Reader, out io.Writer, open Open) error

Run plays until told to quit or until in closes. Cores may keep thread-local state, so it locks a thread for itself.

Types

type Open

type Open func(l ipc.Load, h engine.Handlers) (engine.Engine, error)

Open makes the engine a Load asks for.

Jump to

Keyboard shortcuts

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