       (doto (.setAccessible true))
       (.get app)))
 
-(def player (let [b (Box. Vector3f/ZERO 1 1 1)
-                  geo (Geometry. "Player" b)
-                  mat (load-material "Common/MatDefs/Misc/Unshaded.j3md")]
-              (.setColor mat "Color" ColorRGBA/Blue)
-              (.setMaterial geo mat)
-              geo))
+(def player (make-box "Player" :x 1 :y 1 :z 1 :color ColorRGBA/Blue))
 
 (def is-running (atom true))
 

;;;; http://jmonkeyengine.org/wiki/doku.php/jme3:beginner:hello_input_system

(ns maqueta.hello.input
  (:use (maqueta application assets))
  (:import (com.jme3.math ColorRGBA Vector3f)
           com.jme3.scene.Geometry
           com.jme3.scene.shape.Box))

  (if (not key-pressed)
    (reset! is-running (not @is-running))))

(defmacro def-pausable
  [name & body]
  `(defn ~name
     [~'app ~'value ~'tpf]
     (if @is-running
       (do ~@body)
       (println "Press P to unpause"))))

(def-pausable rotate
  (.rotate player 0 (* value (get-speed app)) 0))

(def-pausable right
  (let [v (.getLocalTranslation player)]
    (.setLocalTranslation player
                          (+ (.getX v) (* value (get-speed app)))
                          (.getY v)
                          (.getZ v))))

(def-pausable left
  (let [v (.getLocalTranslation player)]
    (.setLocalTranslation player
                          (- (.getX v) (* value (get-speed app)))
                          (.getY v)
                          (.getZ v))))

(defn -main
  [& args]
