Toy Engine
gamedev pkg add samples.toy-engineOverview
An example game engine package: detects toy-engine.json projects, creates them, runs a tiny local game server shown in the game panel, and gives the agent two live tools.
The publisher's README is in the README section.
README
Written by the publisher, shown as published.
Toy Engine — an example game engine package
A complete game engine implemented by a package over the Extension Host (the gameEngines API, stable since package API 0.4.0; SPEC "Engine API over the Extension Host"), with no native binaries:
aigd-package.json— the declarative half:contributes.gameEngines(markers: atoy-engine.jsonfile; no editor;connection: "package"; a browser game view; two starters with preview images inmedia/; ashowcase: the colours, pitch, subtitle and tags of the create dialog). The App detects projects from it without running code.extension.js— the imperative half, registered withaigd.gameEngines.registerEngineinactivate():project.create/validate,editor.launch(startstoy-server.cjswith progress lines),editor.stop,editor.gameView,editor.runIdentity,editor.health, and the agent's live toolsget_state/set_ball.toy-server.cjs— the "game": an HTTP server on127.0.0.1serving the project'sindex.htmland a small control API.
Try it: docs/packages/TRY-IT.md §8. The contract, method by method: ENGINE-PACKAGES.md. gamedev pkg init --engine writes a TypeScript copy of this package under your own id.
Versions
| Version | Released | Needs the app |
|---|---|---|
| 0.1.2Latest | 0.32.0 or newer | |
| 0.1.0 | 0.32.0 or newer |
Install
In the desktop app
Open the Packages window (the package icon in the status bar), select Browse, search samples.toy-engine and click Add to Project.
No app yet? Download AI Game Dev free for Windows, macOS or Linux.
From the terminal
With the gamedev CLI, in your project folder:
gamedev pkg add samples.toy-engineRequirements
- AI Game Dev 0.32.0 or newer
gamedev pkg add samples.toy-engine