Files
akbasic/docs/images
Tachikoma 27837aeabc Add the galaga example: a C engine with akbasic as its enemy brain
A GALAGA-style fixed shooter whose engine is C on libakgl (null physics)
with the interpreter embedded as the scripting engine that owns every
enemy's behavior. One DEF-only script is called per enemy per frame
through a custom akgl_Actor update hook; SELF@, ACTOR@ and GAME@ are host
bindings, so the script reads and writes the engine's real memory -- the
boss even swaps its own damage sprite by raising an actor state bit from
BASIC. Bullets, collision, scoring and screens stay C.

Structure arguments were measured and rejected for the per-frame path:
each pointer parameter spends a value-pool slot the pool never reclaims,
1,015 calls to exhaustion against an unbounded rebind (issue #36).

Built when AKBASIC_WITH_AKGL=ON. Two CTest entries: a 600-frame headless
autoplay run under the dummy SDL drivers, and an interop round-trip test
that links the real script.c and galaga.bas and pins the four boundary
claims, 24,000 sustained calls among them. docs_galaga_figures
regenerates the two checked-in figures. Art is Kenney CC0, byte for
byte, with provenance.

Co-authored-by: andrew <andrew@aklabs.net>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XiGgpHuXUm2mR4Wzndw3dc
2026-08-04 08:47:21 -04:00
..

Generated figures — do not edit

Every PNG in this directory is output, not an asset. Each one is produced by running the BASIC listing shown immediately above it in the chapter, through tools/screenshot.c, and it is checked in only because a reader on the forge has no build tree to generate it from.

To change a picture, change the listing and regenerate:

cmake --build build-akgl --target docs_screenshots

Editing a PNG here by hand puts the picture out of step with the code it illustrates, which is the exact failure this arrangement exists to prevent — and the docs_screenshots test will fail on it, because it re-renders every figure and compares byte for byte.

The tag that ties a figure to its listing is screenshot=NAME in the fence info string, and MAINTENANCE.md documents it along with size=WxH for a figure that needs a surface other than 320 by 200, and text=1 for one whose subject is the text grid rather than a drawing. A tagged block with no image here fails docs_examples in both build configurations, so a figure cannot be added to a chapter and then forgotten.