From e0683e0463ea5664f846154bf0478ff0712e0e71 Mon Sep 17 00:00:00 2001 From: Gene Pasquet Date: Mon, 20 Apr 2026 09:58:49 +0100 Subject: update readme --- README.org | 63 ++++++++++++++++++++++++++++++++------------------------------ 1 file changed, 33 insertions(+), 30 deletions(-) (limited to 'README.org') diff --git a/README.org b/README.org index 8e4db4e..1601e7d 100644 --- a/README.org +++ b/README.org @@ -15,9 +15,10 @@ A 2D tile-driven game engine for Chicken Scheme, built on SDL2. Targets old-scho ** Features +- Tweens with easing helpers - Tile-based physics: gravity, velocity, AABB collision against TMX tilemaps -- Built-in update pipeline: input → acceleration → gravity → x-collision → y-collision → ground detection → entity collisions -- Entities as plists — purely functional, no classes +- Built-in update pipeline (before your =update:= hook): tweens → acceleration → gravity → velocity → tile collisions → ground detection → entity collisions → group sync → animation; input is polled each frame and available to hooks and your own logic +- Entities as association lists (alists) — purely functional, no classes; prefab data is often written as plists and converted when loaded - Data-driven prefab/mixin system for composing entity types - Configurable input: keyboard, joystick, and controller - Asset registry with =preload:= lifecycle hook @@ -27,42 +28,44 @@ A 2D tile-driven game engine for Chicken Scheme, built on SDL2. Targets old-scho ** Status -Early extraction phase. The engine logic is fully working — it powers [[https://genepasquet.itch.io/macroknight][macroknight]], built for Spring Lisp Game Jam 2025. Work is underway to extract it into a standalone, installable Chicken egg. +The engine lives in this repository as modular Chicken units, with demos, docs, and an egg spec (=downstroke.egg=). It still powers [[https://genepasquet.itch.io/macroknight][macroknight]] (Spring Lisp Game Jam 2025). The tree is at release candidate =1.0.0rc1= (=VERSION= in the =Makefile=, same string in the egg and the table below). Macroknight is not yet switched to depend on the published egg — that remains the final validation step. | Milestone | Description | Status | |-----------+------------------------------------+----------| | 1 | Zero-risk module extraction | DONE | -| 2 | Configurable input system | pending | -| 3 | Data-driven entity rendering | pending | -| 4 | Renderer abstraction | pending | -| 5 | Asset preloading | pending | -| 6 | Scene loading via =create:= hook | pending | -| 7 | =make-game= / =game-run!= API | pending | -| 8 | Camera follow | pending | -| 9 | Named scene states | pending | -| 10 | AI tag-based lookup | pending | -| 11 | Package as Chicken egg (v1.0.0rc1) | pending | +| 2 | Configurable input system | DONE | +| 3 | Data-driven entity rendering | DONE | +| 4 | Renderer abstraction | DONE | +| 5 | Asset preloading | DONE | +| 6 | Scene loading via =create:= hook | DONE | +| 7 | =make-game= / =game-run!= API | DONE | +| 8 | Camera follow | DONE | +| 9 | Named scene states | DONE | +| 10 | Tag-based entity lookup | DONE | +| 11 | Package as Chicken egg (v1.0.0rc1) | rc | | 12 | Macroknight ported to use the egg | pending | -Milestones 1–6 are pure refactoring. Milestone 7 is the design pivot where the public API stabilises. Milestones 11–12 produce the first installable egg and validate it against macroknight. +Milestones 1–6 were pure refactoring. Milestone 7 was the API pivot (=make-game=, =game-run!=, pipeline). Milestones 11–12 are packaging and proving the egg against macroknight. Finer-grained planning may live outside this repo (=CLAUDE.md= points to the extraction notes). ** Dependencies System libraries: =SDL2=, =SDL2_image=, =SDL2_mixer=, =SDL2_ttf= -Chicken eggs: +Chicken eggs (mirrors =downstroke.egg=; install what you do not already have): #+begin_example -chicken-install sdl2 sdl2-image expat matchable defstruct \ - srfi-197 simple-logger srfi-64 +chicken-install sdl2 sdl2-image sdl2-ttf expat matchable defstruct list-utils \ + srfi-1 srfi-13 srfi-69 srfi-197 simple-logger #+end_example +From a git checkout, run tests with the =test= egg (=make test= runs =csi -s= on each suite). + Games that ship their own FSM logic (for example with the =states= egg) declare that egg themselves; Downstroke does not depend on it. ** Building #+begin_src sh make # compile all modules to bin/ -make test # run SRFI-64 test suites +make test # run unit tests (=test= egg) make demos # build demo games (verifies they compile) make clean # remove bin/ #+end_src @@ -78,7 +81,7 @@ The canonical version string is =VERSION= at the top of the =Makefile=; it must Modules live at the project root. Each compiles as a Chicken unit (=csc -c -J -unit=). Compile order follows the dependency graph: -: entity, tilemap → world → animation, physics → input → prefabs → mixer → sound → engine +: entity → tween → tilemap → world → input → physics → renderer → assets → animation → engine → mixer → sound → prefabs → scene-loader | Module | Responsibility | |----------------+---------------------------------------------------| @@ -96,18 +99,15 @@ Modules live at the project root. Each compiles as a Chicken unit (=csc -c -J -u | =sound= | Sound registry, music playback | | =engine= | =make-game=, =game-run!=, lifecycle orchestration | -Entities are plists — no classes, purely functional: +Entities are alists at runtime — no classes, purely functional: #+begin_src scheme -(list #:type 'player - #:x 100 #:y 200 #:width 16 #:height 16 - #:vx 0 #:vy 0 - #:gravity? #t #:on-ground? #f - #:tile-id 29 - #:tags '(player) - #:anim-name 'walk - #:animations '((idle #:frames (28) #:duration 10) - (walk #:frames (27 28) #:duration 10))) +'((#:type . player) (#:x . 100) (#:y . 200) (#:width . 16) (#:height . 16) + (#:vx . 0) (#:vy . 0) (#:gravity? . #t) (#:on-ground? . #f) + (#:tile-id . 29) (#:tags . (player)) + (#:anim-name . walk) + (#:animations . (((#:name . walk) (#:frames . (27 28)) (#:duration . 10)) + ((#:name . idle) (#:frames . (28)) (#:duration . 10))))) #+end_src Entity types are composed from mixins declared in a data file: @@ -132,4 +132,7 @@ The =docs/= tree is LLM-generated, and that is expected to continue. ** Credits Engine extracted from [[https://genepasquet.itch.io/macroknight][macroknight]] (Spring Lisp Game Jam 2025). -Code: Gene Pasquet — Levels: Owen Pasquet — Art: [[https://kenney.nl][Kenney]] (1-bit pack) + +- Code: Gene Pasquet +- Demo Levels: Owen Pasquet +- Demo Art: [[https://kenney.nl][Kenney]] (1-bit pack) -- cgit v1.2.3