From 38eee24832fe6da4f135cae455881ab97953b23a Mon Sep 17 00:00:00 2001 From: Gene Pasquet Date: Sat, 18 Apr 2026 02:47:10 +0100 Subject: Refresh docs and re-indent --- animation.scm | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) (limited to 'animation.scm') diff --git a/animation.scm b/animation.scm index 8843512..b7fe9c7 100644 --- a/animation.scm +++ b/animation.scm @@ -1,8 +1,7 @@ (module downstroke-animation * (import scheme (chicken base) - (chicken pretty-print) - (only srfi-1 filter) + (only srfi-1 filter) downstroke-entity downstroke-world) @@ -28,14 +27,14 @@ (define (frame->tile-id frames frame-idx) (let ((frame-def (frame-by-idx frames frame-idx))) (if (list? frame-def) - (car frame-def) - frame-def))) + (car frame-def) + frame-def))) (define (frame->duration frames frame-idx) (let ((frame-def (frame-by-idx frames frame-idx))) (if (list? frame-def) - (cadr frame-def) - 10))) + (cadr frame-def) + 10))) ;; ---- set-animation ---- ;; Switch to a new animation, resetting frame and tick counters. @@ -54,8 +53,8 @@ (filter (lambda (anim) (eq? (animation-ref anim #:name) name)) animations))) (if (pair? matching-anims) - (car matching-anims) - #f))) + (car matching-anims) + #f))) ;; ---- animate-entity ---- ;; Advance the animation tick/frame counter for one game tick. @@ -70,13 +69,13 @@ (if (>= tick duration) (let ((new-frame-id (modulo (+ frame 1) (length frames)))) (entity-set-many entity - `((#:anim-tick . 0) - (#:anim-frame . ,new-frame-id) - (#:tile-id . ,(frame->tile-id frames new-frame-id)) - (#:duration . ,(frame->duration frames new-frame-id))))) + `((#:anim-tick . 0) + (#:anim-frame . ,new-frame-id) + (#:tile-id . ,(frame->tile-id frames new-frame-id)) + (#:duration . ,(frame->duration frames new-frame-id))))) (entity-set-many entity - `((#:anim-tick . ,tick) - (#:tile-id . ,(frame->tile-id frames frame))))))) + `((#:anim-tick . ,tick) + (#:tile-id . ,(frame->tile-id frames frame))))))) (define (animate-entity entity animations) (let* ((anim-name (entity-ref entity #:anim-name #f)) @@ -88,7 +87,6 @@ (define-pipeline (apply-animation animation) (scene entity dt) guard: (entity-ref entity #:animations #f) (let ((animations (entity-ref entity #:animations #f))) - (pp entity) (animate-entity entity animations))) ) ;; End of animation module -- cgit v1.2.3