|
|
@ -31,24 +31,31 @@
|
|
|
|
:count 8
|
|
|
|
:count 8
|
|
|
|
:from 1
|
|
|
|
:from 1
|
|
|
|
:pos 0
|
|
|
|
:pos 0
|
|
|
|
|
|
|
|
:last-cycle 0
|
|
|
|
; seconds per cycle
|
|
|
|
; seconds per cycle
|
|
|
|
:spc 0.08
|
|
|
|
:spc 0.08
|
|
|
|
:last-cycle 0
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}))
|
|
|
|
}))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defn update-player [gamestate player dir]
|
|
|
|
|
|
|
|
(let [player-dir (get-in player [:sprite :d])
|
|
|
|
|
|
|
|
sprite-dir (if (= :? dir) player-dir dir)]
|
|
|
|
|
|
|
|
(as-> player p
|
|
|
|
|
|
|
|
(assoc-in p
|
|
|
|
|
|
|
|
[:sprite :d]
|
|
|
|
|
|
|
|
sprite-dir)
|
|
|
|
|
|
|
|
(if-not (= :? dir)
|
|
|
|
|
|
|
|
(sprites/proc-cycle gamestate p)
|
|
|
|
|
|
|
|
p))))
|
|
|
|
|
|
|
|
|
|
|
|
(defn update-scene [gamestate scenedata]
|
|
|
|
(defn update-scene [gamestate scenedata]
|
|
|
|
(let [player (get-in scenedata [:data :player])
|
|
|
|
(let [player (get-in scenedata [:data :player])
|
|
|
|
dir (input/dirinput :?)
|
|
|
|
dir (input/dirinput)]
|
|
|
|
player (assoc-in player
|
|
|
|
|
|
|
|
[:sprite :d]
|
|
|
|
|
|
|
|
dir)
|
|
|
|
|
|
|
|
player (sprites/proc-cycle gamestate player)]
|
|
|
|
|
|
|
|
(assoc-in scenedata
|
|
|
|
(assoc-in scenedata
|
|
|
|
[:data :player]
|
|
|
|
[:data :player]
|
|
|
|
player)))
|
|
|
|
(update-player gamestate player dir))))
|
|
|
|
|
|
|
|
|
|
|
|
(defn draw-scene [gamestate scenedata]
|
|
|
|
(defn draw-scene [gamestate scenedata]
|
|
|
|
(let [{{:keys [bumper player]} :data} scenedata
|
|
|
|
(let [{{:keys [bumper player]} :data} scenedata
|
|
|
|