Commits

Steve Losh committed b7c4387

Clean up a bit.

  • Participants
  • Parent commits 5724045
  • Tags entry-07-1

Comments (0)

Files changed (3)

File src/caves/core.clj

                  (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))

File src/caves/ui/drawing.clj

         {: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)))
 
 
                         (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)))

File src/caves/world/generation.clj

 (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))