proper stopping.

This commit is contained in:
=
2014-09-15 16:52:10 -07:00
parent fd91c7cc55
commit 73c273afad
2 changed files with 27 additions and 37 deletions

View File

@@ -106,17 +106,15 @@
(merge (texture (animation! (:right ego) :get-key-frame 0.25)) ego)))
(defn update-from-script [screen {{:keys [current started? channel]} :actions :as entities}]
(if (= :end current)
(assoc entities :actions {:channel channel :current nil :started? false})
(if current
(let [entities (if started? entities (actions/begin current screen entities))
entities (actions/continue current screen entities)]
(if (actions/done? current screen entities)
(assoc (actions/terminate current screen entities)
:actions {:channel channel :current nil :started? false})
(assoc-in entities [:actions :started?] true)))
(let [[current _] (alts!! [channel] :default nil)]
(assoc entities :actions {:channel channel :current current :started? false})))))
(if current
(let [entities (if started? entities (actions/begin current screen entities))
entities (actions/continue current screen entities)]
(if (actions/done? current screen entities)
(recur screen (assoc (actions/terminate current screen entities)
:actions {:channel channel :current nil :started? false}))
(assoc-in entities [:actions :started?] true)))
(let [[current _] (alts!! [channel] :default nil)]
(assoc entities :actions {:channel channel :current current :started? false}))))
(defn scaler-fn-with-baseline [baseline minimum-size & [maximum-size]]
(let [maximum-size (or maximum-size 1.0)]