From 03072ef67af0623758a660e2cd3fb5e153133efa Mon Sep 17 00:00:00 2001 From: David Thompson Date: Wed, 24 May 2023 08:09:03 -0400 Subject: Update chickadee manual. --- manuals/chickadee/Agendas.html | 66 +++++++++++++++++++++--------------------- 1 file changed, 33 insertions(+), 33 deletions(-) (limited to 'manuals/chickadee/Agendas.html') diff --git a/manuals/chickadee/Agendas.html b/manuals/chickadee/Agendas.html index f6acd57..51be160 100644 --- a/manuals/chickadee/Agendas.html +++ b/manuals/chickadee/Agendas.html @@ -1,6 +1,6 @@ - - + --> + - + Agendas (The Chickadee Game Toolkit) - - - - - - - - - - - + + + + + + + + + + + - + @@ -84,7 +84,7 @@ ul.no-bullet {list-style: none}

Next: , Up: Scripting   [Contents][Index]

-
+

5.5.1 Agendas

To schedule a task to be performed later, an “agenda” is used. @@ -93,15 +93,15 @@ additional agendas may be created for different purposes. The following example prints the text “hello” when the agenda has advanced to time unit 10.

-
-
(at 10 (display "hello\n"))
+
+
(at 10 (display "hello\n"))
 

Most of the time it is more convenient to schedule tasks relative to the current time. This is where after comes in handy:

-
-
(after 10 (display "hello\n"))
+
+
(after 10 (display "hello\n"))
 

Time units in the agenda are in no way connected to real time. It’s @@ -109,9 +109,9 @@ up to the programmer to decide what agenda time means. A simple and effective approach is to map each call of the update procedure (see Kernel) to 1 unit of agenda time, like so:

-
-
(define (update dt)
-  (update-agenda 1))
+
+
(define (update dt)
+  (update-agenda 1))
 

It is important to call update-agenda periodically, otherwise @@ -124,13 +124,13 @@ a simple matter of not updating the world’s agenda while continuing to update the user interface’s agenda. The current agenda is dynamically scoped and can be changed using the with-agenda special form:

-
-
(define game-world-agenda (make-agenda))
+
+
(define game-world-agenda (make-agenda))
 
-(with-agenda game-world-agenda
-  (at 60 (spawn-goblin))
-  (at 120 (spawn-goblin))
-  (at 240 (spawn-goblin-king)))
+(with-agenda game-world-agenda
+  (at 60 (spawn-goblin))
+  (at 120 (spawn-goblin))
+  (at 240 (spawn-goblin-king)))
 
@@ -211,7 +211,7 @@ registered conditions are met. (returns a value other than #f.)

-
+

Next: , Up: Scripting   [Contents][Index]

-- cgit v1.2.3