google / clojure-turtle

A Clojure library that implements the Logo programming language in a Clojure context
Apache License 2.0
425 stars 41 forks source link

add wait fn #6

Closed echeran closed 8 years ago

echeran commented 8 years ago

Add a wait function that pauses for a given number of milliseconds. If the syntax for sleep in CLJS is different than it is in Java Clojure, then reader conditionals will need to be used.

Because Quil/Processing animates drawings on a loop and repeatedly calls the draw function, the current way that clojure-turtle does drawing may need to be made more intelligent as well. I currently don't foresee that extra work, nor any need to update a turtle's saved state of commands, which means the work here should be straightforward.

atrus159 commented 8 years ago

Just sent a pull request for this. The way drawing is handled did not seem to cause problems with repeat. Will add examples for animation shortly.