       (.html ($ "#theme-details") (:platform theme)))))
 
 (add-watch state :theme-change update-theme)
-
-(defn init-state!
-  "Set the initial state of the game."
-  []
-  (reset! state {:next-piece nil
-                 :piece nil
-                 :position nil
-                 :board empty-board
-
-                 :theme 0
-
-                 :score 0
-                 :level 0
-                 :level-lines 0
-                 :total-lines 0
-
-                 :soft-drop false
-
-                 :quit false
-                 :quit-chan (chan)}))
-
-; required for pausing/resuming the gravity routine
-(def pause-grav (chan))
-(def resume-grav (chan))
-
-(defn try-publish-score!
-  "Inform the server of our current state."
-  []
-  (if @battle
-    (socket/emit "update-player"
-      (select-keys @state [:total-lines :score]))))
-
-;;------------------------------------------------------------
-;; STATE MONITOR
-;;------------------------------------------------------------
-
-(defn drawable-board
-  "Draw the current state of the board."
-  []
-  (let [{piece :piece
-         [x y] :position
-         board :board} @state]
-    (create-drawable-board piece x y board)))
 
 (defn make-redraw-chan
   "Create a channel that receives a value everytime a redraw is requested."

(def music-playing?
  "Boolean flag signaling if the music is playing or not"
  (atom false))

(defn- on-music-playing-change [_ _ _ new-state]
  (let [music-el (.getElementById js/document "music")]

;; STATE OF THE GAME
;;------------------------------------------------------------

(def state
  "The state of the game."
  (atom nil))

(defn init-state!
  "Set the initial state of the game."
  []
  (reset! state {:next-piece nil
                 :piece nil
                 :position nil
                 :board empty-board

                 :theme 0

                 :score 0
                 :level 0
                 :level-lines 0
                 :total-lines 0

                 :soft-drop false

                 :quit false
                 :quit-chan (chan)}))

; required for pausing/resuming the gravity routine
(def pause-grav (chan))
(def resume-grav (chan))

(def battle
  "Boolean flag signaling whether we are in solo or battle mode."
  (atom false))

(def paused?
  "Boolean flag signaling if game is paused or not"
  (atom false))
