              (ha-states @scene))
            scene-a)
 
-(def show-transition-thresholds true)
+(def show-transition-thresholds false)
 
 (defn scene-widget [scene _owner]
   (let [scale 2

                       [:leq :y (- oy h)]
                       ; position.y is > other.y + other.h
                       [:gt :y (+ oy oh)]])))
                (concat walls others))
           ; and will be unsupported next tick
           (map (fn [other]
                  (if (keyword? other)
                    (let [ow w
                          oh h]
                      [:or
                       ; new position.x + width < other.x'
                       ; i.e. x+dx+w < ox+odx i.e. x - ox < odx - w - dx
                       [:leq :x [other :x] (list '- [:d other :x] w [:d :x])]
                       ; new position.x is > other.x' + other.w
                       ; i.e. x+dx > ox+odx+ow i.e. x - ox > odx + ow - dx
                       [:geq :x [other :x] (list '+ [:d other :x] ow (list '- [:d :x]))]
                       ; new position.y + height is < other.y'
                       [:leq :y [other :y] (list '- [:d other :y] h [:d :y])]
                       ; new position.y is > other.y' + other.h
                       [:gt :y [other :y] (list '+ [:d other :y] oh (list '- [:d :y]))]])
                    (let [[ox oy ow oh] other]
                      [:or
                       ; new position.x + width < other.x
                       ; i.e. x+dx+w < ox i.e. x < ox - w - dx
                       [:leq :x (list '- ox w [:d :x])]
                       ; new position.x is > other.x + other.w
                       ; i.e. x+dx > ox+ow i.e. x > ox+ow-dx
                       [:geq :x (list '+ ox ow (list '- [:d :x]))]
                       ; new position.y + height is < other.y
                       [:leq :y (list '- oy h [:d :y])]
                       ; new position.y is > other.y + other.h
                       [:gt :y (list '+ oy oh (list '- [:d :y]))]])))
                (concat walls others)))))

(defn goomba [id x y speed state others walls]
  (let [others (disj others id)
        fall-speed 8]
    (make-ha id                                             ;id
             {:x     x :y y                                 ;init
              :w     16 :h 16

    ; catch guards
    (and (vector? guard-term)
         (#{:gt :geq :leq :lt :and :or} (first guard-term))) (mapcat term-dependencies (rest guard-term))
    ; catch [ID v]
    (and (vector? guard-term)
         (= 2 (count guard-term))) [(first guard-term)]
    ; must be (+-*/ ...)
    (and (not (vector? guard-term))
