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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user