              (defentity "box" "images/box.png" 50 50 48 48
                :action (pickup-action-fn))
              (defentity "door" "images/door2.png" 250 81 128 256
-               :action (fn [ent screen entities]
-                         (cond (:open ent)
-                               (switch-to-room (:current-room screen) :room05)
-                               :else
-                               (if (selected? screen "key")
-                                 (do (change-texture ent "images/door2open.png")
-                                   (assoc ent :open true))
-                                 [ent]))))
+               :action (when-selected "key"
+                                      (change-texture ent "images/door2open.png")
+                                      (assoc ent :action (fn [ent screen entities]
+                                                           (switch-to-room (:current-room screen) :room05)))))
              (arrow :right :room02)]
 
             :room02

             (defentity "bucket" "images/bucket.png" 70 40 48 48
                      :action (pickup-action-fn))
             (defentity "tree" "images/tree.png" 450 30 240 336
               :action (fn [ent screen entities]
                         (if (selected? screen "axe")
                           (do (debug "CUTTING TREE!")
                               (show (some (named "logs") entities)))
                           [ent])))
             (arrow :left :room03)]

            :room05

             (hide (defentity "paper" "images/paper.png" 120 20 50 63
                     :action (pickup-action-fn)))
             (hide (defentity "bucket-in-table" "images/bucket.png" 470 130 50 63
                     :action (when-selected "paper"
                                            (consume "paper" screen)
                                            (assoc ent
                                                   :action (when-selected "lighter"
                                                                          [(dissoc ent :action)
                                                                           (show (some (named "ladder") entities))
                                                                           (show (some (named "smoke-in-bucket") entities))])))))
             (hide (defentity "smoke-in-bucket" "images/smoke.png" 470 181 48 48))
             (defentity "table" "images/table.png" 360 5 320 200
               :action (when-selected "bucket"
                                      (consume "bucket" screen)
                                      [(dissoc ent :action)
                                       (show (some (named "bucket-in-table") entities))]))
             (hide (defentity "ladder" "images/ladder.png" 160 30 60 770
                     :action (fn [ent screen entities]
                               (switch-to-room (:current-room screen) :room06))))
             (defentity "vase" "images/vase.png" 120 30 50 63
               :action (when-selected "hammer"
                                      (show (some (named "paper") entities))))
             (arrow :left :room01)]
            
            :room06
