                                      :vy vy
                                      :current-time current-time}]]]]]
           [:layer {:id :ui} [
-            [Hud {:game-state game-state}]]]]]]])))
+            [Hud {:game-state game-state}]
+            [MapUI {:game-state game-state}]]]]]]])))
 
 #_(defn render-enter-name [state]
   (let [screen (state :screen)

                           ; Always render player
                           [(zc/csx [:text {:style {:position :fixed
                                                    :top (- (get player-pos :y) vy)
                                                    :left (- (get player-pos :x) vx)}}
                                           ["@"]])]
                           npcs)])))

(zc/def-component Map
  [this]

                            :left 30}} [
              [:text {} ["Start Text"]]]]]]]]]])))

(zc/def-component GameOverDead
  [this]
  (let [{:keys [player cause-of-death madlib days-survived turns-survived points]} (zc/props this)
        player-name    (get player :name)
        hp             (get player :hp)
        hunger         (get player :hunger)
        max-hunger     (get player :max-hunger)
        thirst         (get player :thirst)
        max-thirst     (get player :max-thirst)
        will-to-live   (get player :will-to-live)
        cause-of-death (or
                         cause-of-death
                         (cond
                           (<= hp 0)             "massive injuries"
                           (> hunger max-hunger) "literall starving to death"
                           (> thirst max-thirst) "not drinking enough water"
                           (<= will-to-live 0)   "just giving up on life"
                           :else                 "mysterious causes"))]
    (zc/csx
	  [:terminal {} [
		[:group {:id :app} [
		  [:layer {:id :ui} [
            [:view {:style {:left 10}} [
              [:text {} [(format "%s: %s" player-name madlib)]]
              [:text {} [(format "%s: %s" player-name madlib)]]
              [:text {} [""]]
              [:text {} [(format "Points: %s." points)]]
              [:text {} [(format "Survived for %d %s. (%d turns)"
                                   days-survived
                                   (if (> 1 days-survived) "days" "day")
                                   turns-survived)]]
              [:text {} [(format "Died from %s" cause-of-death)]]
              [:text {} [""]]
              [:text {} ["Inventory:"]]
              [:view {} 
                (map-indexed
                  (fn [idx item]
                    (zc/csx [:text {} [(format "%s%s" (if (pos? (get item :count 0))
                                                        (format "%dx " (get item :count))
                                                        "")
                                                      (item :name))]]))
                  (get player :inventory))]]]
              [:text {} [""]]
              [:view {:style {:left 10}} [
                [:text {} [[:text {} ["Play again? ["]]
                           [Highlight {} ["y"]]
                           [:text {} ["/"]]
                           [Highlight {} ["n"]]
                           [:text {} ["] "]]
                           [Highlight {} ["space "]]
                           [:text {} ["- share and compare with other players"]]]]]]]]]]]])))

(zc/def-component GameOverRescued
  [this]
  (let [{:keys [game-state]} (zc/props this)
        rescue-mode (rendgame/rescue-mode game-state)]
    ;; Title
    ;(put-string (game-state :screen) :ui 10 1 (format "%s: %s." player-name madlib))
    ;(put-string (game-state :screen) :ui 18 2 (format "Rescued by %s after surviving for %d days." rescue-mode days-survived))
    ;(put-string (game-state :screen) :ui 10 3 (format "Points: %s." points))
    ;(put-string (game-state :screen) :ui 10 4 "Inventory:")
    ;(doall (map-indexed
    ;  (fn [idx item] (put-string (game-state :screen) :ui 18 (+ idx 5) (item :name)))
    ;  (-> game-state :world :player :inventory)))
    ;(put-string (game-state :screen) :ui 10 22 "Play again? [yn]")))
))

(zc/def-component GameOver
  [this]
  (let [{:keys [game-state]} (zc/props this)
        cur-state      (current-state game-state)
        points         (rs/state->points game-state)
        turns-survived  (get-time game-state)
        turns-per-day   (count (get-in game-state [:data :atmo]))
        days-survived   (int (/ turns-survived turns-per-day))
        player-name     (get-in game-state [:world :player :name])
        madlib          (gen-end-madlib game-state)]
    (case cur-state
      :game-over-dead
        (zc/csx [GameOverDead {:player (get-in game-state [:world :player])
                               :days-survived days-survived
                               :turns-survived turns-survived
                               :points points
                               :cause-of-death (get-in game-state [:world :cause-of-death])
                               :madlib madlib}])
      :game-over-rescued
        (zc/csx [GameOverRescued {:game-state game-state}]))))

(zc/def-component ShareScore
  [this]
