--- a/src/caves/core.clj Sat Oct 13 15:15:48 2012 -0400
+++ b/src/caves/core.clj Sat Oct 13 15:31:20 2012 -0400
@@ -34,7 +34,10 @@
(get-input screen)))))))
(defn new-game []
- (->Game nil [(->UI :start)] nil {:show-regions false}))
+ (map->Game {:world nil
+ :uis [(->UI :start)]
+ :input nil
+ :debug-flags {:show-regions false}}))
(defn main
([] (main :swing false))
--- a/src/caves/ui/drawing.clj Sat Oct 13 15:15:48 2012 -0400
+++ b/src/caves/ui/drawing.clj Sat Oct 13 15:31:20 2012 -0400
@@ -85,8 +85,7 @@
{:keys [location hp max-hp]} player
[x y] location
info (str "hp [" hp "/" max-hp "]")
- info (str info " loc: [" x "-" y "]")
- info (str info " region: [" (get-in game [:world :regions location]) "]")]
+ info (str info " loc: [" x "-" y "]")]
(s/put-string screen 0 hud-row info)))
@@ -120,6 +119,7 @@
(get-region-glyph region-number)
{:fg :blue}))))))
+
(defn highlight-player [screen origin player]
(let [[x y] (get-viewport-coords-of origin (:location player))]
(s/move-cursor screen x y)))
--- a/src/caves/world/generation.clj Sat Oct 13 15:15:48 2012 -0400
+++ b/src/caves/world/generation.clj Sat Oct 13 15:31:20 2012 -0400
@@ -146,5 +146,6 @@
(defn random-world []
(let [world (->World (random-tiles) {})
world (nth (iterate smooth-world world) 3)
- world (populate-world world)]
- (assoc world :regions (get-region-map (:tiles world)))))
+ world (populate-world world)
+ world (assoc world :regions (get-region-map (:tiles world)))]
+ world))