From 995342fb74fdd1ba5aeaa172a428538e7dd0dcdc Mon Sep 17 00:00:00 2001 From: Gene Pasquet Date: Wed, 8 Apr 2026 01:05:50 +0100 Subject: Code cleanup --- docs/api.org | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'docs/api.org') diff --git a/docs/api.org b/docs/api.org index c418ec8..d4dc074 100644 --- a/docs/api.org +++ b/docs/api.org @@ -430,7 +430,8 @@ All entities can have these keys. Not all are required: | ~#:on-ground?~ | boolean | Is entity touching a solid tile below? | | ~#:facing~ | integer | 1 (right) or -1 (left) | | ~#:solid?~ | boolean | Participate in AABB entity collisions? | -| ~#:skip-pipelines~ | list | Symbols naming pipeline steps to skip; physics defines the built-in set (~docs/physics.org~) | +| ~#:skip-pipelines~ | list | Symbols naming pipeline steps to skip; physics defines the built-in set (~docs/physics.org~); ~'tweens~ skips ~step-tweens~ | +| ~#:tween~ | tween/false | Active tween struct, auto-advanced by ~step-tweens~ | | ~#:anim-name~ | symbol | Current animation name | | ~#:anim-frame~ | integer | Current frame index | | ~#:anim-tick~ | integer | Ticks in current frame | @@ -1046,16 +1047,19 @@ Time-based interpolation of numeric entity properties. Library-only — call fro ** ~make-tween~ #+begin_src scheme -(make-tween entity #!key props duration (delay 0) ease (on-complete #f)) +(make-tween entity #!key props duration (delay 0) ease + (on-complete #f) (repeat 0) (yoyo? #f)) #+end_src | Keyword | Description | |---------+-------------| | ~props~ | Alist ~((#:key . target-number) ...)~ | | ~duration~ | Milliseconds of interpolation after ~delay~ | -| ~delay~ | Initial wait in ms (default 0) | +| ~delay~ | Initial wait in ms (default 0, first cycle only) | | ~ease~ | Symbol (e.g. ~quad-in-out~) or ~(lambda (t) ...)~ with ~t~ in [0,1] | -| ~on-complete~ | Optional ~(lambda (entity) ...)~ once at completion | +| ~on-complete~ | Optional ~(lambda (entity) ...)~ once at final completion (not called with ~repeat: -1~) | +| ~repeat~ | ~0~ = play once (default), ~N~ = replay N extra times, ~-1~ = loop forever | +| ~yoyo?~ | ~#f~ (default) = same direction, ~#t~ = reverse each cycle | ** ~tween-step~ @@ -1067,6 +1071,14 @@ Returns two values: updated tween struct and updated entity. ~dt~ is elapsed mil ** ~tween-finished?~ / ~tween-active?~ +** ~step-tweens~ + +#+begin_src scheme +(step-tweens entity dt) +#+end_src + +Pipeline step: auto-advances ~#:tween~ on an entity. No-op if ~#:tween~ is absent. Removes ~#:tween~ when the tween finishes. Skipped when ~'tweens~ is in ~#:skip-pipelines~. See ~docs/tweens.org~ for patterns. + ** Easing exports ~ease-linear~, ~ease-quad-in~, ~ease-quad-out~, ~ease-quad-in-out~, ~ease-cubic-in~, ~ease-cubic-out~, ~ease-cubic-in-out~, ~ease-sine-in-out~, ~ease-expo-in~, ~ease-expo-out~, ~ease-expo-in-out~, ~ease-back-out~, ~ease-named~, ~ease-resolve~. -- cgit v1.2.3