                                          ha
                                          Infinity
                                          (required-transitions ha)))
+        ; If req has a non-simple interval, replace that with the first interval in the set
+        req (if (simple? (:interval req))
+              req
+              (update req :interval first))
         _ (println "New required transitions" (transition-intervals has
                                                                     ha
                                                                     Infinity

(defonce last-time nil)

(defn moving-inc-c [vbl width limit]
  [[:lt vbl (- limit width)]
   [:geq vbl (list '- limit width [:d vbl])]])

(defn moving-dec-c [vbl limit]
  [[:gt vbl limit]
   [:leq vbl (list '- limit [:d vbl])]])

(defn moving-inc [vbl width other-ha]
  [[:lt vbl [other-ha vbl] (- width)]
   [:geq vbl [other-ha vbl] (list '- [:d other-ha vbl] [:d vbl] width)]])

(defn moving-dec [vbl width other-ha]
  [[:gt vbl [other-ha vbl] width]
   [:leq vbl [other-ha vbl] (list '+ [:d other-ha vbl] width (list '- [:d vbl]))]])

(defn between-c [vbl min max]
  [[:geq vbl min]
   [:lt vbl max]])

(defn goomba [id x y speed state others walls]

               (mapcat (fn [[x y w h]]
                         ; right-transition means bumping into right side of wall
                         [(make-edge :right
                                     [:and
                                      (moving-dec-c :x (+ x w))
                                      (between-c :y (- y 16) (+ y h))]
                                     #{:required [:this id] [:other [:wall x y w h]]})])
                       walls)
               ; x > x2 + 16 && x + dx*frame <= x2 + dx2*frame + 16 -->
