diff --git a/src/play_clj/core.clj b/src/play_clj/core.clj index 29a4275..fa6b39b 100644 --- a/src/play_clj/core.clj +++ b/src/play_clj/core.clj @@ -64,11 +64,11 @@ (defn ^:private add-to-timeline! [screen-atom entities] (let [screen @screen-atom] - (when (:record? screen) + (when (:timeline screen) (swap! screen-atom update-in [:timeline] - #(conj (or %1 []) %2) + conj [(:total-time screen) entities])))) (defn defscreen* diff --git a/src/play_clj/core_utils.clj b/src/play_clj/core_utils.clj index 39248ed..217c061 100644 --- a/src/play_clj/core_utils.clj +++ b/src/play_clj/core_utils.clj @@ -80,8 +80,8 @@ specified path. (defn rewind! "Returns the most recent entities vector saved in the timeline after removing -the last `steps` from it. The timeline is recorded by calling -`(update! screen :record? true)`. +the last `steps` from it. Start recording to the timeline by calling +`(update! screen :timeline [])`. If there are 100 items saved in the timeline and `(rewind! screen 1)` is called, it will remove the last one and return the entities vector from the 99th item.