Skip to content

Instantly share code, notes, and snippets.

@newsomc newsomc/atom.cljs
Last active Dec 14, 2015

Embed
What would you like to do?
(def game-state (atom {:state nil
:audio []
:ghosts [{:get-tick 0, :eatable nil, :color nil, :eaten nil, :specs "#00FFDE", :position nil, :due nil, :map nil, :direction nil} {:get-tick 0, :eatable nil, :color nil, :eaten nil, :specs "#FF0000", :position nil, :due nil, :map nil, :direction nil} {:get-tick 0, :eatable nil, :color nil, :eaten nil, :specs "#FFB8DE", :position nil, :due nil, :map nil, :direction nil} {:get-tick 0, :eatable nil, :color nil, :eaten nil, :specs "#FFB847", :position nil, :due nil, :map nil, :direction nil}]
:ghost-specs ["#00FFDE" "#FF0000" "#FFB8DE" "#FFB847"]
:eaten-count 0
:level 0
:tick 0
:n-score 0
:block-size nil}))
(defn reset-ghost-state! [ghost]
(doseq [i (range (count (:ghosts @state/game-state)))]
(swap! game-state assoc-in [i :eaten] true)
(swap! game-state assoc-in [i :eatable] true)
(swap! game-state assoc-in [i :position] {:x 90 :y 80})))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.