A totally different approach to night.

This commit is contained in:
2015-05-05 08:41:30 -07:00
parent b8c47d674d
commit e233c67004
5 changed files with 212 additions and 27 deletions

View File

@@ -43,11 +43,15 @@
(let [t (dec (/ t duration))]
(+ (* delta (inc (* t t t))) start)))
(defn tween [id screen path start end duration & {:keys [finish ease]}]
(defn tween [id screen path start end duration & {:keys [finish ease entities]}]
(let [ease (or ease ease-linear)
finish (or finish identity)
start-time (or (:total-time screen) 0.0)
delta (- end start)]
start (if (and entities (= start :current))
(get-in entities path)
start)
delta (- end start)
]
(fn [e total-time]
(let [delta-time (- total-time start-time)
pct-done (min (/ delta-time duration) 1.0)