Permalink
Browse files

Clean up a bit.

  • Loading branch information...
1 parent 8c8a177 commit 4e69fe7d677b83ca112b54237695eb88f7884be5 @sjl committed Oct 13, 2012
Showing with 9 additions and 5 deletions.
  1. +4 −1 src/caves/core.clj
  2. +2 −2 src/caves/ui/drawing.clj
  3. +3 −2 src/caves/world/generation.clj
View
5 src/caves/core.clj
@@ -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))
View
4 src/caves/ui/drawing.clj
@@ -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)))
View
5 src/caves/world/generation.clj
@@ -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))

0 comments on commit 4e69fe7

Please sign in to comment.