                        :gravity-interval 500
                        :score 0
                        :level 1
-                       :running? true}))
+                       :mode :game}))
 
 (defn time-left
   "Given a timestamp and a time interval, returns a remaining interval


(defn run-game-cycle
  "Puts everything together."
  [{:keys [running? tetrimino] :as state}]
  (if running?
    (-> state
        process-time
        process-keyboard
        release-keyboard
        process-gravity
        maybe-score
        maybe-level-up
        maybe-next-tetrimino
        maybe-game-over)
    state))

(.addEventListener js/document "keydown" #(swap! game-state handle-key-press (.-keyCode %)) false)
(render-loop)

             \m "#a081ee" ;magenta
             \r "#ff5349" ;red
             " " nil})
(def controls {37 :left ; ←
               39 :right ; →
               40 :down ; ↓
               38 :rotate ; ↑
               80 :pause ; p
               })
(def directions {:down [0 1]
                 :right [1 0]
                 :left [-1 0]})
