 
 (defn main []
   (om/root
-    (fn [app owner]
-      (reify
-        om/IRender
-        (render [_]
-          (if (>= 0 (get-in app [:hero :life]))
-            (dom/h1 nil "GAME OVER")
-            (dom/div nil
-                     (om/build status-bar app)
-                     (if (get-in app [:design-game])
-                       (dom/div #js {:className "grid on-top"}
-                                (om/build grid (:grid app) {:init-state {:design true}}))
-
-                       (dom/div #js {:className "grid" :tabIndex 0 :onKeyUp (fn [e] (stop-moving e app)) :onKeyDown (fn [e] (start-moving e app) (.preventDefault e))}
-                                (om/build hero app)
-                                (om/build grid (:grid app))
-                                )))
-            )
-          )))
-    app-state
-    {:target (. js/document (getElementById "app"))}))
+   (fn [app owner]
+     (reify
+       om/IRender
+       (render [_]
+         (dom/div nil
+                  (when (>= 0 (get-in app [:hero :life]))
+                    (dom/h1 nil "GAME OVER"))
+                  (when (get-in app [:hero :game-won])
+                    (dom/h1 nil "YEAH!")
+                    )
+                  (om/build status-bar app)
+                  (if (get-in app [:design-game])
+                    (dom/div #js {:className "grid on-top"}
+                             (om/build grid (:grid app) {:init-state {:design true}}))
+
+                    (dom/div #js {:className "grid" :tabIndex 0 :onKeyUp (fn [e] (stop-moving e app)) :onKeyDown (fn [e] (start-moving e app) (.preventDefault e))}
+                             (om/build hero app)
+                             (om/build grid (:grid app))
+                             )))
+         )))
+   app-state
+   {:target (. js/document (getElementById "app"))}))

    ))

(def id->tile-class
  {0 nil
   1 "ground"
   2 "bridge"
   3 "fence"
   4 "lava"
   5 "water"
   6 "spikes"
   7 "start"
   8 "exit"})

(defn editable-input [ctx owner]
  (reify

        app @app-state
        below-left (update-in left [0] + 1)
        below-right (update-in right [0] + 1)]
    (some #{["1"]} [(get-in app (into [:grid] left)) (get-in app (into [:grid] right))]
          )))

(defn on-block? [position, block-no]
  (let [[left right] (hero-feet-coords position)
        app @app-state
        below-left (update-in left [0] + 1)
        below-right (update-in right [0] + 1)]
    (some #{[block-no]} [(get-in app (into [:grid] left)) (get-in app (into [:grid] right))]
          )))

(defn moving? [hero]
