summary history branches tags files
commit:9a2ef9d57c2faa01f9d4d8883982231a7ffc90ea
author:mrmekon
committer:mrmekon
date:Mon Apr 9 22:57:47 2012 -0400
parents:09078b024cb08007498307fa48cb2a8a7ff6fb9f
Really stupid fix for Safari crashing.  Thread game logic in multiple steps instead of one long one.
diff --git a/project.clj b/project.clj
line changes: +1/-1
index 44c5cd6..080369f
--- a/project.clj
+++ b/project.clj
@@ -5,7 +5,7 @@
   :dependencies [[org.clojure/clojure "1.3.0"]
                  [noir "1.2.1"]]
   :dev-dependencies [[lein-marginalia "0.7.0-SNAPSHOT"]]
-  :plugins [[lein-cljsbuild "0.1.3"]]
+  :plugins [[lein-cljsbuild "0.1.6"]]
   :cljsbuild {
               :builds [{:source-path "tempest"
                         :compiler {:output-to "resources/public/tempest.js"

diff --git a/tempest/tempest/core.cljs b/tempest/tempest/core.cljs
line changes: +27/-26
index 9b92cc0..e9b74a9
--- a/tempest/tempest/core.cljs
+++ b/tempest/tempest/core.cljs
@@ -47,32 +47,33 @@ after passing through all the other functions.  This implements the game loop.
 (defn game-logic-playable
   "Called by next-game-state when game and player are active."
   [game-state]
-  (->> game-state
-       clear-player-segment
-       dequeue-keypresses
-       highlight-player-segment
-       maybe-change-level
-       clear-frame
-       draw-board
-       render-frame
-       remove-collided-entities
-       remove-collided-bullets
-       update-projectile-locations
-       update-enemy-locations
-       maybe-split-tankers
-       handle-dead-enemies
-       maybe-enemies-shoot
-       maybe-make-enemy
-       check-if-player-captured
-       update-player-if-shot
-       check-if-enemies-remain
-       update-entity-is-flipping
-       update-entity-flippyness
-       animate-player-capture
-       update-frame-count
-       maybe-render-fps-display
-       schedule-next-frame
-       ))
+  (let [gs1 (->> game-state
+                 clear-player-segment
+                 dequeue-keypresses
+                 highlight-player-segment
+                 maybe-change-level
+                 clear-frame
+                 draw-board
+                 render-frame)
+        gs2 (->> gs1
+                 remove-collided-entities
+                 remove-collided-bullets
+                 update-projectile-locations
+                 update-enemy-locations
+                 maybe-split-tankers
+                 handle-dead-enemies
+                 maybe-enemies-shoot)
+        gs3 (->> gs2
+                 maybe-make-enemy
+                 check-if-player-captured
+                 update-player-if-shot
+                 check-if-enemies-remain
+                 update-entity-is-flipping
+                 update-entity-flippyness
+                 animate-player-capture
+                 update-frame-count
+                 maybe-render-fps-display)]
+    (->> gs3 schedule-next-frame)))
 
 
 (defn game-logic-non-playable

diff --git a/tempest/tempest/levels.cljs b/tempest/tempest/levels.cljs
line changes: +12/-12
index 353a6dc..8ca3b18
--- a/tempest/tempest/levels.cljs
+++ b/tempest/tempest/levels.cljs
@@ -304,25 +304,25 @@ Functions related to generating paths representing levels.
                       {:flipper 20 :tanker 10}
                       {:flipper 0.01 :tanker 0.005})
     (make-level-entry *level5_lines* false
-                      {:flipper 20}
-                      {:flipper 0.01})
+                      {:flipper 20 :tanker 10}
+                      {:flipper 0.01 :tanker 0.005})
     (make-level-entry *level6_lines* true
-                      {:flipper 20}
-                      {:flipper 0.01})
+                      {:flipper 20 :tanker 10}
+                      {:flipper 0.01 :tanker 0.005})
     (make-level-entry *level7_lines* false
-                      {:flipper 20}
-                      {:flipper 0.01})
+                      {:flipper 20 :tanker 10}
+                      {:flipper 0.01 :tanker 0.005})
     (make-level-entry *level8_lines* false
-                      {:flipper 20}
-                      {:flipper 0.01}
+                      {:flipper 20 :tanker 10}
+                      {:flipper 0.01 :tanker 0.005}
                       :length-fn #(* 10 %)
                       :steps 400)
     (make-level-entry *level9_lines* false
-                      {:flipper 20}
-                      {:flipper 0.01})
+                      {:flipper 20 :tanker 10}
+                      {:flipper 0.01 :tanker 0.005})
     (make-level-entry *level10_lines* false
-                      {:flipper 20}
-                      {:flipper 0.01})
+                      {:flipper 20 :tanker 10}
+                      {:flipper 0.01 :tanker 0.005})
     ])