 (ns tetris.core
   (:require [reagent.core :as r]))
 
-(defonce ^:const initial-tick-frequency 500)
-(defonce ^:const width 10)
-(defonce ^:const height 20)
+(defonce initial-tick-frequency 500)
+(defonce width 10)
+(defonce height 20)
 
 (defonce empty-grid
   (vec (take height (repeat (vec (take width (repeat \ )))))))


     (when game-over?
       [:a.title
        {:href "#"
         :on-click #(reset! world-atom
                            (new-block {:grid empty-grid}))}
        "GAME OVER"])]))

  (swap! world-atom move direction))

(defn main-component [world-atom]
  (let [{:keys [game-over? grid score]
         :as   world} @world-atom
        button        (fn [dir]
                        (let [f #(do (move! world-atom dir)
                                     (.preventDefault %))]
                          [:button {:class (name dir)
                                    :on-click f
                                    :on-touch-start f}
                           (name dir)]))]
    [:div.main
     {:class (when game-over? "game-over")}

