   )
 
 (defn vertical-block [original-hero new-hero]
-  (let [original-bottom (get-in original-hero [:position :bottom])
-        supported (on-supporting-block? (update-in (original-hero :position) [:bottom] - 1))]
+  (let [original-position (get-in original-hero [:position])
+        original-bottom (get-in original-hero [:position :bottom])
+        supported (on-supporting-block? original-position)]
     (if supported
       (let [nearest-vertical-border (* (ceil (/ original-bottom 70)) 70)
             newer-hero (update-in new-hero [:position :bottom] (fn [_] nearest-vertical-border))]

    ))

(defn on-red-trampete? [red-trampete hero]
  (if (on-block? (get-in hero [:position]) 3)
    (update-in hero [:dy] (fn [old-dy] (+ old-dy (-> red-trampete first))))
    hero
    ))

(defn on-blue-trampete? [blue-trampete hero]
  (if (on-block? (get-in hero [:position]) 4)
    (update-in hero [:dy] (fn [old-dy] (+ old-dy (-> blue-trampete first))))
    hero
    ))

(defn spike-damage [hero]
  (if (on-block? (get-in hero [:position]) 2)
    (update-in hero [:life] - 1)
    hero
    ))

     ]
    ))

(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] below-left)) (get-in app (into [:grid] below-right))]
          )))

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

(defn on-supporting-block? [position]
  (on-block? position 1))

(defn moving? [hero]
  (not= 0 (hero :dx))
