 
 (defn create [game]
   (set! (.-backgroundColor (.-stage game)) "#ffffff")
-  (.tileSprite (.-add game) 0 0 605 605 "border")
+  (.tileSprite (.-add game) 0 0
+               *phaser-border-width*
+               *phaser-border-height* "border")
   (create-possible-grids "possible-grid" game)
   (create-all-pieces "white-piece" "black-piece" game)
   (create-text game)

(def ^:dynamic *visible-possible-grids-pos* '())
(def ^:dynamic *default-player-piece* rcore/*black-piece*)
(def ^:dynamic *default-pc-piece* rcore/*white-piece*)
(def ^:dynamic *phaser-width* 905)
(def ^:dynamic *phaser-height* 605)
(def ^:dynamic *game* (js/Phaser.Game.
                       *phaser-width* *phaser-height*
                       js/Phaser.AUTO "game_div"))


(defn ^export start [game]
  (init-phaser game)
  (.add (.-state game) "main"
        (clj->js {:preload preload
                  :create create
                  }))
  (.start (.-state game) "main"))

(defprotocol Functor
  (restart [this]))
