 (defn init-world []
   {:places {:0 (init-place-0)}
    :current-place :0
+   :show-inventory? false
    :last-command nil
    :player {:hp 10
+            :max-hp 10
+            :$ 0
+            :xp 0
+            :level 0
             :sym "@"
-            :pos {:x 2 :y 1}}})
+            :pos {:x 2 :y 1}
+            :inventory []}})
 
 (defn current-place [state]
   (let [current-place (-> state :world :current-place)]

      (-> state :world :player :pos :y)
      (-> state :world :player :sym)
      {:fg :green})
    ;; draw status bar
    (s/put-string (state :screen) 0  23
      (format " %s $%d HP:%d(%d) Pw:%d Amr:%d XP:%d/%d T%d                             "
        "location-detail" 0 10 0 0 0 0 100 0) {:fg :black :bg :white})
    (s/redraw (state :screen))))

;; Example setup and tick fns
(defsource setup []
  (let [screen (s/get-screen :swing)]
    (s/start screen)
    {:world (init-world) :screen screen}))

(defn tick [state]
  (let [keyin  (s/get-key-blocking (state :screen))]
    (println "got " keyin " type " (type keyin))
    (let [newstate (update-state state keyin)]
      (render newstate)
      newstate)))


      \j (move-down state)
      \k (move-up state)
      \l (move-right state)
      \i (toggle-inventory state)
      \o (set-last-command state :open)
      \c (set-last-command state :close)
      state)))
