aboutsummaryrefslogtreecommitdiff
path: root/docs/api.org
diff options
context:
space:
mode:
authorGene Pasquet <dev@etenil.net>2026-04-08 01:05:50 +0100
committerGene Pasquet <dev@etenil.net>2026-04-08 01:05:50 +0100
commit995342fb74fdd1ba5aeaa172a428538e7dd0dcdc (patch)
tree82a60034eaa097191d360fe07e4ef3a52dae9c2a /docs/api.org
parent0c3a700aa94a0256c5e5b1a14819f10b3d3e869b (diff)
Code cleanup
Diffstat (limited to 'docs/api.org')
-rw-r--r--docs/api.org20
1 files changed, 16 insertions, 4 deletions
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~.