diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/coroutine.scm | 12 |
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) |