summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2014-02-06 20:49:28 -0500
committerDavid Thompson <dthompson2@worcester.edu>2014-02-06 20:49:28 -0500
commit21ff408c45685afacd3c0fffb3f81c46e9b00874 (patch)
tree11d3575ae00255a1319273ece6d94040d31795dc /examples
parentc83760250f25373cd5f66ca096b5a762da82d072 (diff)
Remove dynamic scoping of agendas.
* 2d/agenda.scm: (*global-agenda*, current-agenda, with-agenda): Delete. (agenda?, agenda-time): Export. (schedule-every, schedule-each): Rename schedule-every to schedule-each. (schedule-next): Delete. * 2d/game.scm: (game-agenda): New variable. (update): Tick game-agenda. * 2d/repl.scm: Use new agenda API. * 2d/sprite.scm: Use new agenda API. * 2d/time.scm: (time-every, time-each, time-delay): Change signature and use new agenda API. * examples/coroutine.scm: Use new agenda API. * examples/particles.scm: Use new agenda API.
Diffstat (limited to 'examples')
-rw-r--r--examples/coroutine.scm6
-rw-r--r--examples/particles.scm2
2 files changed, 4 insertions, 4 deletions
diff --git a/examples/coroutine.scm b/examples/coroutine.scm
index 480aa46..a479a66 100644
--- a/examples/coroutine.scm
+++ b/examples/coroutine.scm
@@ -20,12 +20,12 @@
sprite
(vector2 (random window-width)
(random window-height)))
- (wait 15)
+ (wait game-agenda 15)
(set-sprite-rotation! sprite (random 360))
- (wait 15)
+ (wait game-agenda 15)
(script))
-(schedule-next script)
+(schedule game-agenda script)
(add-hook! draw-hook (lambda (dt alpha) (draw-sprite sprite)))
diff --git a/examples/particles.scm b/examples/particles.scm
index d1362fe..0b5d6dd 100644
--- a/examples/particles.scm
+++ b/examples/particles.scm
@@ -62,7 +62,7 @@
(define (update)
(for-each update-particle! particles))
-(schedule-every update)
+(schedule-each game-agenda update)
(add-hook! draw-hook draw)
(with-window (make-window #:title "Particles"