       )
     ))
 
+(defn blocked? [original-hero hero]
+  (if (in-block? (get-in hero [:position]) 1)
+    (update-in hero [:position :left] (fn[_] (get-in original-hero [:position :left])))
+    hero
+    ))
+
 (defn move-right [hero]
   (let [left-position (get-in hero [:position :left])]
     (if (moving? hero)

    ))

(defn logger [key hero]
  ;;(console-log {key (get-in hero [:position :left])})
  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))
