From 75246ee21c47046f1b40dd3868d46b416102f95f Mon Sep 17 00:00:00 2001 From: oakes Date: Tue, 27 May 2014 16:10:32 -0400 Subject: [PATCH] Revert change to the add-timer! function --- src/play_clj/core_utils.clj | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/play_clj/core_utils.clj b/src/play_clj/core_utils.clj index 51d4e43..13d86be 100644 --- a/src/play_clj/core_utils.clj +++ b/src/play_clj/core_utils.clj @@ -111,7 +111,7 @@ specified path. new-timer)) (defn add-timer! - "Creates a [Timer](http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/utils/Timer.html) + "Returns a [Timer](http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/utils/Timer.html) which will fire the :on-timer function one or more times (depending on the given arguments). In the :on-timer function, the id will be passed in the screen map. If a timer with that id already exists in the screen, it will be stopped and @@ -124,14 +124,14 @@ replaced with a new timer. ; wait 2 seconds, run once, and then run 3 more times at 10 second intervals (add-timer! screen :spawn-enemy 2 10 3)" ([screen id delay] - (-> (create-and-add-timer! screen id) - (.scheduleTask (task* screen id) delay))) + (doto (create-and-add-timer! screen id) + (.scheduleTask (task* screen id) delay))) ([screen id delay interval] - (-> (create-and-add-timer! screen id) - (.scheduleTask (task* screen id) delay interval))) + (doto (create-and-add-timer! screen id) + (.scheduleTask (task* screen id) delay interval))) ([screen id delay interval repeat] - (-> (create-and-add-timer! screen id) - (.scheduleTask (task* screen id) delay interval repeat)))) + (doto (create-and-add-timer! screen id) + (.scheduleTask (task* screen id) delay interval repeat)))) (defn remove-timer! "Stops and removes the timer associated with `id`, returning it or nil if not