# HG changeset patch # User Steve Losh # Date 1350156680 14400 # Node ID b7c4387ab70176a1848cc15a5b1c4851665730c5 # Parent 572404588054dd5c2d436ad4b0d13b71e3f8b9db Clean up a bit. diff -r 572404588054 -r b7c4387ab701 src/caves/core.clj --- 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)) diff -r 572404588054 -r b7c4387ab701 src/caves/ui/drawing.clj --- 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))) diff -r 572404588054 -r b7c4387ab701 src/caves/world/generation.clj --- 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))