                {:id "football" :url "images/football-th.png"}
                ])
      (fn [director]
-       (log/info logger " Images loaded. Creating scene.")
-       (doto director
-         (.addAudio "chime" "sounds/22267__zeuss__the-chime.ogg" ;; "sounds/22267__zeuss__the-chime.mp3"
-                    ) 
-         (.addAudio "doppp" "sounds/8001__cfork__cf-fx-doppp-01.ogg" ;; "sounds/8001__cfork__cf-fx-doppp-01.wav"
-                    )
-         (.addAudio "flopp" "sounds/8006__cfork__cf-fx-flopp-03-dry.ogg" ;; "sounds/8006__cfork__cf-fx-flopp-03-dry.wav"
-                    )
-         (.addAudio "munching" "sounds/27877__inequation__munching.ogg" ;; "sounds/27877__inequation__munching.wav"
-                    )
-         (.addAudio "song" "sounds/448614_Happiness_Alone.ogg"))
-       (let [scene (. director (createScene))
-             background (doto (CAAT/Actor.) 
-                          (.setBackgroundImage (.getImage director "room")))
-             basket (gen-basket director :x 440 :y 240)
-             bookshelf (gen-bookshelf scene)
-             counter (gen-count-actor 6 :on-total-reached (fn [e] (add! scene (gen-winning-screen scene))))
-             basket-objects (map
-                             #(make-draggable-into % basket scene 
-                                                   (fn [] (throw-into-basket director scene basket % counter))
-                               :valid-fn (fn [] (and (not (.isOpened basket)) (not (.eating basket)))))
-                             [(gen-animated-actor scene :image "football" :animation-indices [0] :draggable? true :thumbnail [60 60])
-                              (gen-animated-actor scene :image "car" :animation-indices [0] :draggable? true :thumbnail [60 60])
-                              (gen-animated-actor scene :image "blocks" :animation-indices [0] :draggable? true)
-                              (gen-animated-actor scene :image "teddy" :animation-indices [0 1 0 2] :draggable? true)])
-             bookshelf-objects (map
-                                #(make-draggable-into % bookshelf scene 
-                                  (fn []
-                                    (.setExpired % true)
-                                    (. bookshelf (inc-book-count))
-                                    (. counter (inc))))
-                                [(gen-animated-actor scene :image "book" :animation-indices [2] :default-index 2 :key-frames 3 :draggable? true)
-                                 (gen-animated-actor scene :image "book" :animation-indices [0] :default-index 0 :key-frames 3 :draggable? true)])
-             objects (concat basket-objects bookshelf-objects)] 
-         (log/info logger " Displaying scene")
-         (add! scene background)
-         (add! scene basket)
-         (add! scene counter) 
-         (add! scene bookshelf)
+       (binding [*director* director]
+        (log/info logger " Images loaded. Creating scene.")
+        (doto director
+          (.addAudio "chime" "sounds/22267__zeuss__the-chime.ogg" ;; "sounds/22267__zeuss__the-chime.mp3"
+                     ) 
+          (.addAudio "doppp" "sounds/8001__cfork__cf-fx-doppp-01.ogg" ;; "sounds/8001__cfork__cf-fx-doppp-01.wav"
+                     )
+          (.addAudio "flopp" "sounds/8006__cfork__cf-fx-flopp-03-dry.ogg" ;; "sounds/8006__cfork__cf-fx-flopp-03-dry.wav"
+                     )
+          (.addAudio "munching" "sounds/27877__inequation__munching.ogg" ;; "sounds/27877__inequation__munching.wav"
+                     )
+          (.addAudio "song" "sounds/448614_Happiness_Alone.ogg"))
+        (let [scene (. director (createScene))
+              background (doto (CAAT/Actor.) 
+                           (.setBackgroundImage (.getImage director "room")))
+              basket (gen-basket scene :x 440 :y 240)
+              bookshelf (gen-bookshelf scene)
+              counter (gen-count-actor 6 :on-total-reached (fn [e] (add! scene (gen-winning-screen scene))))
+              basket-objects (map
+                              #(make-draggable-into % basket scene 
+                                                    (fn [] (throw-into-basket director scene basket % counter))
+                                                    :valid-fn (fn [] (and (not (.isOpened basket)) (not (.eating basket)))))
+                              [(gen-animated-actor scene :image "football" :animation-indices [0] :draggable? true :thumbnail [60 60])
+                               (gen-animated-actor scene :image "car" :animation-indices [0] :draggable? true :thumbnail [60 60])
+                               (gen-animated-actor scene :image "blocks" :animation-indices [0] :draggable? true)
+                               (gen-animated-actor scene :image "teddy" :animation-indices [0 1 0 2] :draggable? true)])
+              bookshelf-objects (map
+                                 #(make-draggable-into % bookshelf scene 
+                                                       (fn []
+                                                         (.setExpired % true)
+                                                         (. bookshelf (inc-book-count))
+                                                         (. counter (inc))))
+                                 [(gen-animated-actor scene :image "book" :animation-indices [2] :default-index 2 :key-frames 3 :draggable? true)
+                                  (gen-animated-actor scene :image "book" :animation-indices [0] :default-index 0 :key-frames 3 :draggable? true)])
+              objects (concat basket-objects bookshelf-objects)] 
+          (log/info logger " Displaying scene")
+          (add! scene background)
+          (add! scene basket)
+          (add! scene counter) 
+          (add! scene bookshelf)
          
-         (dotimes [index (count objects)]
-           (let [object (nth objects index)]
-             (add!
-              scene
-              object
-              :position [(+ (rand-int 30) (* (/ 600 (count objects)) index) 100)
-                         (+ (rand-int 50) 360)])))
-         ;; (add! scene (gen-winning-screen scene))
-         )))))
+          (dotimes [index (count objects)]
+            (let [object (nth objects index)]
+              (add!
+               scene
+               object
+               :position [(+ (rand-int 30) (* (/ 600 (count objects)) index) 100)
+                          (+ (rand-int 50) 360)])))
+          ;; (add! scene (gen-winning-screen scene))
+          ))))))

     (assert (actor? target))
     (assert (keyword? event-name))
     (assert (fn? handler))
     (cond (= event-name :mouse-enter)
           (m/wrap target.mouseEnter [e oldf]
                   (handler e oldf))
           (= event-name :mouse-exit)
           (m/wrap target.mouseExit [e oldf]
                   (handler e oldf))
           (= event-name :mouse-drag)
           (m/wrap target.mouseDrag [e oldf]
                   (handler e oldf))))
  ([target e1 h1 e2 h2 & more]
     (listen target e1 h1)
     (listen target e2 h2)
     (when more
       (apply listen target more))))

(defn gen-actor [scene & {:keys [image draggable? fill-style position size sprite-index]
                          :or {draggable? false}}]
  (assert (scene? scene) "First arg must be a scene.")
  (when (and image fill-style)
   (log/info logger (str "WARNING: both :image & :fill-style set. No image will be visible.")))


   (gen-move-behavior :from [0 0] :to [50 50] :time 120)
   (gen-move-behavior :from [50 50] :to [0 0] :time [120 120])"
  ;; TODO: Currently, :to & :from are relative to (0,0) with respect
  ;; to the container that target is in. This is counterintuitive and
  ;; should be relative to the targets current position. Also I
  ;; propose the following API change:
  ;;
  ;; (gen-move-behavior target :to [10 10]) ;; movement to absolute position within parent container
  ;; (gen-move-behavior target :up 5 :left 3) ;; relative (to current position) movement
  ;; (gen-move-behavior target :from [0 0] :up 5) ;; initial absolute position & relative movement upwards
  ;; (gen-move-behavior target :to [[10 10] [10 20]]) ;; multiple absolute positions
  ;; (gen-move-behavior target :to [[:quadric 10 10 5 5]] ;; support for non-linear paths
  [& {:keys [from to time auto-rotate?]
      :or {time 120 auto-rotate? false}}]
  (let [nr (fn [n] (or n 0))
