|
|
@ -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))
|
|
|
|
:e (assoc obj
|
|
|
|
(= d :e)
|
|
|
|
:x (+ x pxs))
|
|
|
|
(assoc obj
|
|
|
|
:n (assoc obj
|
|
|
|
:x (+ x pxs))
|
|
|
|
:y (- y pxs))
|
|
|
|
(= d :n)
|
|
|
|
:s (assoc obj
|
|
|
|
(assoc obj
|
|
|
|
:y (+ y pxs))
|
|
|
|
:y (- y pxs))
|
|
|
|
obj)))
|
|
|
|
(= d :s)
|
|
|
|
|
|
|
|
(assoc obj
|
|
|
|
|
|
|
|
:y (+ y pxs))
|
|
|
|
|
|
|
|
:else 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])
|
|
|
|