         style (clj->js { :font "35px Arial" :fill "#000000" :align "left" })]
     (set! (.-pieceCountText game) (.text (.-add game) 615 20 text style))))
 
+(defn ^export restart [game]
+  (reset! *border* rcore/*default-border*)
+  (reset! *phaser-border* [[] [] [] [] [] [] [] []])
+  (reset! *visible-possible-grids-pos* '())
+  (.start (.-state game) "main"))
+
 (defn create-buttons [game]
   (let [restart-button
         (.sprite (.-add game) 675 515 "restart-button")]
     (set! (.-inputEnabled restart-button) true)
     (set! (.-useHandCursor (.-input restart-button)) true)
     (.add (.-onInputDown (.-events restart-button))
-          (fn [b] (restart)) game)))
+          (fn [b] (restart game)) game)))
 
 (defn create [game]
   (set! (.-backgroundColor (.-stage game)) "#ffffff")

(def *border* (atom rcore/*default-border*))
(def *phaser-border* (atom [[] [] [] [] [] [] [] []]))
(def *visible-possible-grids-pos* (atom '()))
(def ^:dynamic *default-player-use-piece* rcore/*black-piece*)
(def ^:dynamic *default-pc-use-piece* rcore/*white-piece*)


                  }))
  (.start (.-state game) "main"))

(start *game*)
