                              :life 100
                              :position (hero-start-position grid-content)
                              :bounce 10
+                             :game-won false
                              }
-                      :game-over false
                       :design-game false
                       :foo ["bar"]
                       :grid grid-content}))

      (dom/div nil
               (dom/h1 nil (get-in app [:hero :life]))
               (dom/button #js {:onClick (fn [e] (om/transact! app :design-game (fn [bool] (not bool))) false)}
                 (if (app :design-game)
                   "Play"
                   "Design"))
               )))
  )

(defn start-moving [e app]
  (condp = (aget e "keyCode")
    88 (om/update! app [:hero :dx] 10)
    90 (om/update! app [:hero :dx] -10)
    nil
    )
  )

        (update-in newer-hero [:dy] (fn [_] 0))
        )
      new-hero
      )
    ))

(defn logger [key hero]
  ;;(console-log {key (get-in hero [:position :left])})
  hero
  )

(defn home? [original-hero hero]
  (if (on-block? (get-in original-hero [:position]) "4")
    (merge original-hero {:game-won true})
    hero
    )
  )

(defn game-over? [original-hero hero]
  (if (> 0 (get-in hero [:position :bottom]))
    (merge hero {:life 0})
    hero
    )
  )

(defn hero [app owner]
  (reify
    om/IWillMount
    (will-mount [_]
      (console-log "mounting...")
      (go-loop []
        (<! (timeout 30))

        (let [original-hero (get-in @app [:hero])
              new-hero (-> original-hero
                           grav
                           ((partial vertical-block original-hero))
                           move-left
                           move-right
                           bounce
                           ((partial home? original-hero))
                           ((partial game-over? original-hero))
                           )]

          (om/transact! app [:hero] (fn [hero] (merge hero new-hero)))
          )
        (recur)
        )
      )
    om/IRenderState
