run-simulation -> animate
svn: r15995
This commit is contained in:
parent
03134e9107
commit
73e9e77830
|
@ -89,7 +89,7 @@ The simplest kind of animated @tech{world} program is a time-based
|
||||||
supply a function that creates a scene for each natural number. By handing
|
supply a function that creates a scene for each natural number. By handing
|
||||||
this function to the teachpack displays the simulation.
|
this function to the teachpack displays the simulation.
|
||||||
|
|
||||||
@defproc[(run-simulation [create-image (-> natural-number/c scene)])
|
@defproc[(animate [create-image (-> natural-number/c scene)])
|
||||||
true]{
|
true]{
|
||||||
|
|
||||||
opens a canvas and starts a clock that tick 28 times per second. Every
|
opens a canvas and starts a clock that tick 28 times per second. Every
|
||||||
|
@ -97,7 +97,7 @@ The simplest kind of animated @tech{world} program is a time-based
|
||||||
number of ticks passed since this function call. The results of these
|
number of ticks passed since this function call. The results of these
|
||||||
function calls are displayed in the canvas. The simulation runs until you
|
function calls are displayed in the canvas. The simulation runs until you
|
||||||
click the @tt{Stop} button in DrScheme or close the window. At that
|
click the @tt{Stop} button in DrScheme or close the window. At that
|
||||||
point, @scheme[run-simulation] returns the number of ticks that have
|
point, @scheme[animate] returns the number of ticks that have
|
||||||
passed.
|
passed.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -110,9 +110,15 @@ Example:
|
||||||
(overlay (circle 10 'solid 'green)
|
(overlay (circle 10 'solid 'green)
|
||||||
(rectangle 40 4 'solid 'green)))
|
(rectangle 40 4 'solid 'green)))
|
||||||
|
|
||||||
(run-simulation create-UFO-scene)
|
(animate create-UFO-scene)
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@defproc[(run-simulation [create-image (-> natural-number/c scene)])
|
||||||
|
true]{
|
||||||
|
|
||||||
|
@scheme[animate] was originally called @scheme[run-simulation], and this
|
||||||
|
binding is retained for backwards compatibility}
|
||||||
|
|
||||||
@;-----------------------------------------------------------------------------
|
@;-----------------------------------------------------------------------------
|
||||||
@section[#:tag "interactive"]{Interactions}
|
@section[#:tag "interactive"]{Interactions}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user