lots of ending improvements

This commit is contained in:
Bryce Covert
2018-02-10 18:32:29 -08:00
parent c37309fac1
commit 2ab191c2d5
47 changed files with 1112 additions and 356 deletions

View File

@@ -677,6 +677,40 @@
(skip-type [this screen entities]
:none))))
(defn fade [entities time between]
(run-action entities
(begin [this screen entities]
(-> entities
(assoc-in [:tweens :fade-out] (tween/tween :fade-out screen [:fade :opacity] 0.0 1.0 time))
(assoc-in [:tweens :fade-out-music] (tween/tween :fade-out-music screen [:volume :value] 1.0 0.0 time))))
(continue [this screen entities]
entities)
(done? [this screen entities]
(>= (get-in entities [:fade :opacity]) 1.0))
(terminate [this screen entities]
(between entities))
(skip-type [this screen entities]
:none))
(run-action entities
(begin [this screen entities]
(assoc-in entities [:tweens :fade-out] (tween/tween :fade-out screen [:fade :opacity] 1.0 0.0 time)))
(continue [this screen entities]
entities)
(done? [this screen entities]
(>= (get-in entities [:fade :opacity]) 0.0))
(terminate [this screen entities]
(between entities))
(skip-type [this screen entities]
:none)))
(defn transition-background [entities new-background [x y] & {:keys [transition-music? between time face type]}]
(let [transition-music? (if (nil? transition-music?) true transition-music?)
@@ -789,6 +823,23 @@
(defn respond [entities line & more]
(apply do-dialogue entities :ego line more))
(defn tween [entities id tween-maker]
(run-action entities
(begin [this screen entities]
(assoc-in entities [:tweens id] (tween-maker screen entities)))
(continue [this screen entities]
entities)
(done? [this screen entities]
(nil? (get-in entities [:tweens id])))
(terminate [this screen entities]
entities)
(skip-type [this screen entities]
:none)))
(defn glad [entities]
(actions/run-action entities
(begin [this screen entities]