Fix(Animation): Drive Pac-Man mouth animation from game loop, not draw callback

The draw callback receives no delta-time, so animation was stuck at 0.
Split draw-pacman! into draw (position/rotation) and animate-pacman!
(sprite sequence advancement). Animation is now called from the game
loop which has the real delta-time.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
joren
2026-03-23 11:12:56 +01:00
parent caac996acd
commit 1ac72f03a7
2 changed files with 16 additions and 11 deletions

View File

@@ -28,9 +28,10 @@
((level 'key-press!) key)))
;; game-loop :: number -> /
;; Called each frame for game state updates.
;; Called each frame for game state updates and animation.
(define (game-loop delta-time)
((level 'update!) delta-time))
((level 'update!) delta-time)
((draw 'animate-pacman!) delta-time))
;; start! :: -> /
;; Starts the game by registering all callbacks.