   ; Set frame rate to 30 frames per second.
   (q/frame-rate 30)
   {:entities
-    {:bucket {:x 50 :y 150 :width 20 :height 50}
-     :window {:x 10 :y 10 :width 50 :height 50}
+    {;objects
+     :bucket {:x 50 :y 150 :width 20 :height 50}
+     :window {:x 400 :y 50 :width 50 :height 50}
+     :window-open {:x 460 :y 50 :width 50 :height 50 :hidden true}
      :stone {:x 200 :y 100 :width 20 :height 40 :hidden true}
+     :broom {:x 300 :y 100 :width 20 :height 40 :hidden true}
+     :starfish {:x 200 :y 200 :width 20 :height 40}
+     :bottle {:x 300 :y 300 :width 20 :height 40}
+     :seagull {:x 400 :y 200 :width 20 :height 40 :hidden true}
+     ;actions
      :look {:x 10 :y (- (q/height) 20) :width 50 :height 20 :label "Look"}
      :flap {:x 60 :y (- (q/height) 20) :width 50 :height 20 :label "Flap"}}
    :current-status "Hello little mermaid."

        new-entity (dissoc entity :hidden)]
    (assoc-in state [:entities hidden-entity] new-entity)))

(def actions-map
  {[:look :window] {:text "You look outside the window and see your home, the mighty ocean." :action []}
   [:look :bucket] {:text "You see a bucket. Maybe there is something inside." :action []}
   [:flap :window] {:text "You're too far away for that"}
   [:flap :bucket] {:text "You flap against the bucket. BÄM. The bucket falls over and stones spill on the floor." :action [unhide :stone]}
   [:look :stone] {:text "There are stones on the floor. You can easily reach them" :action []}})

(defn point-in-rect? [entity mx my]
  (and
   (> mx (:x entity))
   (< mx (+ (:x entity) (:width entity)))
   (> my (:y entity))


(defn update-current-action [state]
  (let [last-clicked (:last-clicked state)
        todo (get actions-map last-clicked)
        actions-count (count (:action todo))]
    (if (and (= (count last-clicked) 2) todo)
      (let [new-state
            (assoc state :current-status (:text todo))]
        (cond
          (= actions-count 1) ((first (:action todo)) new-state)
          (= actions-count 2) ((first (:action todo)) new-state (last (:action todo)))
          :else new-state))
      state)))

(defn update-state [state]
