Skip to content

Instantly share code, notes, and snippets.

@newsomc
Last active December 14, 2015 20:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save newsomc/5142729 to your computer and use it in GitHub Desktop.
Save newsomc/5142729 to your computer and use it in GitHub Desktop.
(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