From 9d8fa39f051dcf079cfeb3209efb53a34ca7f52e Mon Sep 17 00:00:00 2001 From: David Thompson Date: Wed, 17 Jul 2013 18:45:31 -0400 Subject: Update coroutine example. --- examples/coroutine.scm | 12 +++++++----- 1 file 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) -- cgit v1.2.3