 (def app-state (atom {:text "Hello Chestnut!"
                       :hero {:move false
                              :position {:bottom 560 :left 70}
-                             :jump false
+                             :jump {:time nil :bottom nil}
                              }
 
                       :grid [[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]

    {:left (+ left 1) :bottom bottom}
    ))

(defn vertical-position [app]
  (let [current-vertical (get-in app [:hero :position :bottom])
        current-block-no (most-supportive-block (beneath-1px (get-in app [:hero :position])))]
    (if (>= current-block-no 1)
      current-vertical
      (- current-vertical 1)
      )
    ))


  (condp = (aget e "keyCode")
    88 (om/update! app [:hero :move] :right)
    90 (om/update! app [:hero :move] :left)
    32 (when-not (get-in @app [:hero :jump :start])
         (om/update! app [:hero :jump :start] (.getTime (js/Date.)))
         (om/update! app [:hero :jump :bottom] (get-in @app [:hero :position :bottom])))
    nil
    )
  )
