From 422766edb6369154ecb83b63b90b67decb7b878e Mon Sep 17 00:00:00 2001 From: David Thompson Date: Sun, 27 Apr 2014 21:18:01 -0400 Subject: Fix update procedure. This is embarrassing. * 2d/game.scm (update): Actually use the iterative inner procedure. --- 2d/game.scm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/2d/game.scm b/2d/game.scm index 09c3c11..befe784 100644 --- a/2d/game.scm +++ b/2d/game.scm @@ -64,15 +64,15 @@ "Call the update callback. The update callback will be called as many times as tick-interval can divide LAG. The return value is the unused accumulator time." - (define (iter ticks) + (define (iter lag ticks) (cond ((>= ticks max-ticks-per-frame) lag) ((>= lag tick-interval) (tick-agenda! game-agenda) - (update (- lag tick-interval))) + (iter (- lag tick-interval) (1+ ticks))) (else lag))) - (iter 0)) + (iter lag 0)) (define (alpha lag) "Calculate interpolation factor in the range [0, 1] for the -- cgit v1.2.3