Last active
December 14, 2015 20:19
-
-
Save newsomc/5142729 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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