diff --git a/project.clj b/project.clj index b57ba24..a6d081b 100644 --- a/project.clj +++ b/project.clj @@ -3,6 +3,7 @@ :url "http://example.com/FIXME" :dependencies [[org.clojure/clojure "1.6.0"] [mw-engine "0.1.0-SNAPSHOT"] + [mw-parser "0.1.0-SNAPSHOT"] [lib-noir "0.8.4"] [ring-server "0.3.1"] [selmer "0.6.8"] @@ -14,7 +15,8 @@ :repl-options {:init-ns mw-ui.repl} :plugins [[lein-ring "0.8.10"] - [lein-environ "0.5.0"]] + [lein-environ "0.5.0"] + [lein-marginalia "0.7.1"]] :ring {:handler mw-ui.handler/app :init mw-ui.handler/init :destroy mw-ui.handler/destroy} @@ -29,4 +31,4 @@ :injections [(require 'pjstadig.humane-test-output) (pjstadig.humane-test-output/activate!)] :env {:dev true}}} - :min-lein-version "2.0.0") \ No newline at end of file + :min-lein-version "2.0.0") diff --git a/resources/public/css/standard.css b/resources/public/css/standard.css index 850d329..45138dc 100644 --- a/resources/public/css/standard.css +++ b/resources/public/css/standard.css @@ -37,6 +37,8 @@ body { position: fixed; z-index: 149; background-color: black; + background-image: "../img/earth-space-strip.jpg"; + background-repeat: no-repeat; color: white; } @@ -122,23 +124,4 @@ label { border-right: thin solid gray; } -table { - width 100%; - padding: 0; - border: 0.25em solid silver; -} -td, th { - margin: 0; - padding: 0.25em 1em; -} - -th { - border: thin solid gray; - background-color: silver; -} - -td { - border: thin solid silver; - background-color: white; -} diff --git a/resources/public/css/states.css b/resources/public/css/states.css index 02dfd23..f3001ed 100644 --- a/resources/public/css/states.css +++ b/resources/public/css/states.css @@ -1,16 +1,20 @@ td.waste { background-color: gray; -} +} -td.pasture { +td.water { + background-color: blue; +} + +td.pasture, td.grassland { background-color: lime; } -td.scrub { +td.heath { background-color: chartreuse; } -td.scrub2 { +td.scrub { background-color: lime; } diff --git a/resources/public/img/20x20/hill.png b/resources/public/img/20x20/hill.png new file mode 100644 index 0000000..8be86e4 Binary files /dev/null and b/resources/public/img/20x20/hill.png differ diff --git a/resources/public/img/earth-space-strip.jpg b/resources/public/img/earth-space-strip.jpg new file mode 100644 index 0000000..6f54286 Binary files /dev/null and b/resources/public/img/earth-space-strip.jpg differ diff --git a/src/mw_ui/render_world.clj b/src/mw_ui/render_world.clj index c5fc466..52af650 100644 --- a/src/mw_ui/render_world.clj +++ b/src/mw_ui/render_world.clj @@ -1,6 +1,7 @@ (ns mw-ui.render-world (:require [mw-engine.core :as engine] [mw-engine.world :as world] + [mw-engine.heightmap :as heightmap] [mw-engine.natural-rules :as rules] [hiccup.core :refer [html]] [noir.session :as session])) @@ -32,7 +33,12 @@ (defn render-world-table "Render the world implied by the session as a complete HTML page." [] - (let [world (or (session/get :world) (world/make-world 20 20)) + (let [world (or (session/get :world) + (engine/transform-world + (heightmap/apply-heightmap + (world/make-world 20 20) + "resources/public/img/20x20/hill.png") + rules/init-rules)) rules (or (session/get :rules) rules/natural-rules) generation (+ (or (session/get :generation) 0) 1) w2 (engine/transform-world world rules)]