          (body! body :create-fixture))
     body))
 
+(defn get-entity-at-cursor
+  [screen entities]
+  (let [coords (input->screen screen (input! :get-x) (input! :get-y))]
+    (find-first (fn [{:keys [x y width height brick?] :as entity}]
+                  (-> (rectangle x y width height)
+                      (rectangle! :contains (:x coords) (:y coords))
+                      (and brick?)))
+                entities)))
+
 (defscreen main-screen
   :on-show
   (fn [screen entities]


  :on-touch-down
  (fn [screen entities]
    (let [coords (input->screen screen (input! :get-x) (input! :get-y))
          world (:world screen)
          bb [(- (:x coords) 0.1) (- (:y coords) 0.1) (+ (:x coords) 0.1) (+ (:y coords) 0.1)]
          pt-vec2 (vector-2 (input! :get-x) (input! :get-y))
          cb (reify QueryCallback
               (reportFixture [_ fixture]
                 (if (.testPoint fixture pt-vec2)
                   true)))])))

(defgame totem-destroyer-game
  :on-create

    body))

(defn create-brick-entity!
  [screen brick x y width height]
  (assoc brick
         :body (create-brick-body! screen width height)
         :x (/ x world-scale) :y (/ y world-scale)
         :width (/ width world-scale) :height (/ height world-scale)))

(defn create-idol-body!
