Commits

Steve Losh  committed d4d14e3

Don't redraw the screen more times than is necessary.

  • Participants
  • Parent commits f5fdc66

Comments (0)

Files changed (1)

File src/caves/core.clj

 (defn run-game [game screen]
   (loop [{:keys [input uis] :as game} game]
     (when-not (empty? uis)
-      (draw-game game screen)
       (if (nil? input)
-        (recur (get-input (update-in game [:world] tick-all) screen))
+        (do
+          (draw-game game screen)
+          (recur (get-input (update-in game [:world] tick-all) screen)))
         (recur (process-input (dissoc game :input) input))))))
 
 (defn new-game []