summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2013-07-17 18:45:31 -0400
committerDavid Thompson <dthompson2@worcester.edu>2013-07-17 18:45:31 -0400
commit9d8fa39f051dcf079cfeb3209efb53a34ca7f52e (patch)
tree0478033b611155bce219d1ffce60f3e1a07e5171
parentb13eb4d5486dfd7193b5daf07da43224f73141c4 (diff)
Update coroutine example.
-rw-r--r--examples/coroutine.scm12
1 files changed, 7 insertions, 5 deletions
diff --git a/examples/coroutine.scm b/examples/coroutine.scm
index 6e743d1..0c6f3b4 100644
--- a/examples/coroutine.scm
+++ b/examples/coroutine.scm
@@ -9,6 +9,7 @@
(2d vector)
(2d input)
(2d helpers)
+ (2d agenda)
(2d coroutine))
(define window-width 800)
@@ -37,10 +38,11 @@
;; Simple script that moves the sprite to a random location every
;; second.
-(coroutine
- (while #t
- (set-sprite-position! sprite (vector (random window-width)
- (random window-height)))
- (wait 60)))
+(agenda-schedule
+ (colambda ()
+ (while #t
+ (set-sprite-position! sprite (vector (random window-width)
+ (random window-height)))
+ (wait 60))))
(run-game-loop)