Steve Losh avatar Steve Losh committed b7c4387

Clean up a bit.

Comments (0)

Files changed (3)


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


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


 (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))
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.