Don't redraw the screen more times than is necessary.
author |
Steve Losh <steve@stevelosh.com> |
date |
Fri, 13 Jul 2012 23:41:30 -0400 |
parents |
f5fdc662f11f
|
children |
e2ed8ba084a0
|
branches/tags |
(none) |
files |
src/caves/core.clj |
Changes
--- a/src/caves/core.clj Fri Jul 13 23:34:53 2012 -0400
+++ b/src/caves/core.clj Fri Jul 13 23:41:30 2012 -0400
@@ -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 []