Permalink
Browse files

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

  • Loading branch information...
1 parent f32a929 commit 0fae7ff66fcccf004a539664545357d7c8923841 @sjl committed Jul 14, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/caves/core.clj
View
@@ -19,9 +19,10 @@
(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 []

0 comments on commit 0fae7ff

Please sign in to comment.