summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2014-04-27 21:18:01 -0400
committerDavid Thompson <dthompson2@worcester.edu>2014-04-27 21:18:01 -0400
commit422766edb6369154ecb83b63b90b67decb7b878e (patch)
tree08ed0a1c539b87b0a9ae4b3524ea3fbde918d18d
parent87fd3c3e5fafb8af0f4218308b24abb1a4ba7603 (diff)
Fix update procedure.
This is embarrassing. * 2d/game.scm (update): Actually use the iterative inner procedure.
-rw-r--r--2d/game.scm6
1 files 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