much better love.

This commit is contained in:
Bryce Covert
2015-10-10 11:32:40 -07:00
parent 5981c1d303
commit 48cde82d75
33 changed files with 1480 additions and 1375 deletions

View File

@@ -788,14 +788,7 @@
:none)))
(defn in-love [entities]
(let [seen-love (get-in @entities [:state :has-seen-love?])]
(when (or (not seen-love)
(< (rand-int 10) 3))
(transition-music entities :love :duration 1.0)
(play-animation entities :ego :love)
(actions/update-state entities (fn [s] (assoc s :has-seen-love? true)))
(transition-music entities nil :duration 1.0))))
(defn fade-in-georgia [entities]
@@ -848,14 +841,34 @@
(fade-out-georgia entities)
(transition-music entities nil :duration 1.0))
(defn wait-for-animation [entities target anim]
(actions/run-action entities
(begin [this screen entities]
entities)
(continue [this screen entities]
entities)
(done? [this screen entities]
(animation! (actions/find-animation (get-in entities [:room :entities target]) anim)
:is-animation-finished
(- (:total-time screen) (get-in entities [:room :entities target :anim-start]))))
(terminate [this screen entities]
entities)
(skip-type [this screen entities]
:none)))
(defn in-love [entities]
(let [seen-love (get-in @entities [:state :has-seen-love?])]
(when (or (not seen-love)
(< (rand-int 10) 3))
(transition-music entities :love :duration 1.0)
(begin-animation entities :georgia-face :love)
(fade-in-georgia entities)
(play-animation entities :ego :love)
(actions/update-state entities (fn [s] (assoc s :has-seen-love? true)))
(update-state entities (fn [s] (assoc s :has-seen-love? true)))
(wait-for-animation entities :georgia-face :love)
(fade-out-georgia entities)
(do-stop entities :georgia-face)
(transition-music entities nil :duration 1.0))))