6 Commits
Author SHA1 Message Date
Storm DragonandClaude Opus 5.5 30b42f3efe Add an air horn sound, for the end of a timed match.
ui.air_horn(seconds=1.2): two brassy reeds a major third apart, each a pair of
detuned sawtooths, scooping up into pitch, blaring with a faint flutter, then a
short tail. Grave Racer's destruction derby ends with it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 23:09:51 -05:00
Storm DragonandClaude Opus 5.5 4ef866717c Keyboard and game controller support through actions, with rebinding and rumble.
Games name their actions with default keys and controller inputs and ask
Controls whether they are held, pressed or how far they are pushed. Library
menus, text display, message boxes, cut scenes, power bars and pause work
with a controller. controls_menu lets players rebind and set rumble; only
changes from the defaults are saved in config.ini.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 20:17:31 -05:00
Storm Dragon 7e50223dde Improvements to the menu system. 2026-11-29 01:29:31 -05:00
Storm DragonandClaude Opus 5.5 962f695226 Generated footsteps on grass, leaves, gravel, snow, wood and concrete
movement.footstep(surface, seed) makes one footstep, and each seed gives a
slightly different step, so a game can register several and play them at
random. Every surface except grass is the heel landing and then the toe:

- leaves: bright crisp crackles that spread out, over a soft rustle.
- gravel: dozens of small stones knocking under the heel and toe, over a
  low grind.
- snow: a muffled crunch that gets denser as the foot packs it down.
- wood: a hollow knock with the boards ringing, and on some steps a creak.
- concrete: a hard heel and a scuff of grit on the toe.

Grass is one swish instead, with blades flicking off the shoe, as a foot
swings through. The loose surfaces are built from many tiny filtered
bursts of noise, and how many there are, how bright, and how they spread
over the step is what tells stones from snow or leaves. Each surface was
tuned by ear against how real footsteps sound.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-28 22:00:22 -05:00
Storm DragonandClaude Opus 5.5 541a2d9007 check_for_exit notices escape anywhere in the queue and keeps other events
check_for_exit returned after looking at only the first waiting event, and
it threw away every event it read, so an Escape behind another key was
missed and a game's own key presses were lost. Now it returns True if any
Escape press is waiting, takes only the Escape presses off the queue, and
puts every other event back in the same order.

x_powerbar and y_powerbar called it inside their own event loops and
ignored what it returned, so all those calls did was lose key presses,
sometimes the Space that sets the power. They no longer call it, and
Escape still does nothing in them, as before.

The new tests in tests/test_input.py use real pygame events; four of them
fail on the old code. AI-README.md now says what check_for_exit is for.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-28 20:51:31 -05:00
Storm DragonandClaude Opus 5.5 f1cb50f985 Added AI-README.md, a guide for AI assistants making audio games
It covers what matters most for an assistant building a game with the
library: audio-first rules, setting up a game, a minimal working game,
the menu, the keys every game should handle, speech, generated and
positional sounds, and generated music. For work on the library itself,
it covers the code style and the tests, and says that fingerprints are
only remade after a human has listened to the sound. The README links to
it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-28 20:33:35 -05:00