              (reset! end true))))
 
 (defn main-view [state]
-  (r/with-let [game-state (r/cursor state [:game])]
+  (r/with-let [game-state (r/cursor state [:game])
+               max-score (r/cursor state [:max-score])]
     [:h1 "mRunner"]
     [:div.game-wrapper
      (if @game-state
-       [game-view game-state]
+       [game-view game-state max-score]
        [:button.start {:on-click #(reset! game-state initial-state)} "start"])]))
 
 

      (swap! state update :score + 10)
      (swap! state assoc-in [:obstacles 0 :scored] true))))

(defn game-loop [state end]
  (let [{:keys [cur-time]} @state
        next-time (js/performance.now)
        delta (- next-time cur-time)]

(defonce app-state
  (r/atom {:data nil
           :game nil
           :max-score (or (get-item "runner-max-score") 0)
           :view [:init]}))

(def initial-state
