ronin experiment 6 - event based animation
ronin switched from an amiation loop to a event based animation system which allow cool stuff like initalizing code for the animation or reference objects that get preserved between frames. And it also makes it a lot easier to interact between the animation callback function and other event sources like osc events or mouseclicks
this is my first event based animation:
(def pos {:x 30 :y 30})
(defn draw () (
(clear)
(times 10 (lambda (a) (
(def r (mul a (mod (time 0.02) 40)))
(stroke
(circle (of pos :x) (of pos :y) r)
(sub 11 a) "white")
)))
(if (lt (mod (time 0.02) 40) 1) (
(set pos :x (random (of (frame) :w)) :y (random (of (frame) :h)))
))
))
(on "animate" draw)
See also:
Ronin experiment 21 - morphing lissajous states
ronin experiment 20 - transform flower
ronin experiment 19 - Sonic Pi visualizer
Ronin experiment 18 - Rainbow
Ronin experiment 17 - boids
ronin experiment 20 - transform flower
ronin experiment 19 - Sonic Pi visualizer
Ronin experiment 18 - Rainbow
Ronin experiment 17 - boids