Skip to content

Instantly share code, notes, and snippets.

@fffej
Created July 29, 2009 20:07
Show Gist options
  • Save fffej/158365 to your computer and use it in GitHub Desktop.
Save fffej/158365 to your computer and use it in GitHub Desktop.
(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