|
|
@ -28,20 +28,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
(defn moved-object [obj pxs]
|
|
|
|
(defn moved-object [obj pxs]
|
|
|
|
(let [{:keys [x y d]} obj]
|
|
|
|
(let [{:keys [x y d]} obj]
|
|
|
|
(cond
|
|
|
|
(case d
|
|
|
|
(= d :w)
|
|
|
|
:w (assoc obj
|
|
|
|
(assoc obj
|
|
|
|
|
|
|
|
:x (- x pxs))
|
|
|
|
:x (- x pxs))
|
|
|
|
(= d :e)
|
|
|
|
:e (assoc obj
|
|
|
|
(assoc obj
|
|
|
|
|
|
|
|
:x (+ x pxs))
|
|
|
|
:x (+ x pxs))
|
|
|
|
(= d :n)
|
|
|
|
:n (assoc obj
|
|
|
|
(assoc obj
|
|
|
|
|
|
|
|
:y (- y pxs))
|
|
|
|
:y (- y pxs))
|
|
|
|
(= d :s)
|
|
|
|
:s (assoc obj
|
|
|
|
(assoc obj
|
|
|
|
|
|
|
|
:y (+ y pxs))
|
|
|
|
:y (+ y pxs))
|
|
|
|
:else obj)))
|
|
|
|
obj)))
|
|
|
|
|
|
|
|
|
|
|
|
(defn bump-into [obj obj2]
|
|
|
|
(defn bump-into [obj obj2]
|
|
|
|
(let [{:keys [x y w h d]} obj
|
|
|
|
(let [{:keys [x y w h d]} obj
|
|
|
@ -61,7 +57,7 @@
|
|
|
|
:e (assoc obj :x (- (+ cx cw) w 1))
|
|
|
|
:e (assoc obj :x (- (+ cx cw) w 1))
|
|
|
|
:n (assoc obj :y (inc cy))
|
|
|
|
:n (assoc obj :y (inc cy))
|
|
|
|
:s (assoc obj :y (- (+ cy ch) h 1))
|
|
|
|
:s (assoc obj :y (- (+ cy ch) h 1))
|
|
|
|
:? obj)))
|
|
|
|
obj)))
|
|
|
|
|
|
|
|
|
|
|
|
(defn pps->px [gamestate obj]
|
|
|
|
(defn pps->px [gamestate obj]
|
|
|
|
(let [prev (get-in gamestate [:timing :prev])
|
|
|
|
(let [prev (get-in gamestate [:timing :prev])
|
|
|
|