Created
July 29, 2009 20:07
-
-
Save fffej/158365 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn animate | |
[_] | |
(when @running | |
(send-off *agent* animate) | |
(doseq [agent-boid boids] | |
(send-off agent-boid behave (remove (partial = @agent-boid) (map deref boids)))) | |
(.repaint canvas) | |
(Thread/sleep animation-delay-ms))) | |
(defn start-animate [] | |
(swap! running (constantly true)) | |
(send-off animator animate)) | |
(defn stop-animate [] | |
(swap! running (constantly false))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment