ending is beginning to be fun.

This commit is contained in:
Bryce Covert
2018-02-08 22:01:56 -08:00
67 changed files with 982 additions and 651 deletions

View File

@@ -59,68 +59,37 @@
(defn explode [entities]
(actions/run-action entities
(begin [this screen entities]
(let [start-time (atom nil)]
(actions/run-action entities
(begin [this screen entities]
(reset! start-time (:total-time screen))
(-> entities
(update-in [:room :entities :bloodclot] #(actions/start-animation screen % :explode))
(update-in [:room :entities] dissoc :broken-jewel)
(update-in [:room :entities] dissoc :bloodclot-head)
(assoc-in [:room :entities :ego :facing] :right)
(update-in [:room :entities :ego] #(actions/start-animation screen % :crawl))))
(-> entities
(update-in [:room :entities :bloodclot] #(actions/start-animation screen % :grow))
(update-in [:room :entities] dissoc :broken-jewel)
(update-in [:room :entities] dissoc :bloodclot-head)
(assoc-in [:room :entities :ego :facing] :right)
(update-in [:room :entities :ego] #(actions/start-animation screen % :crawl))))
(continue [this screen entities]
(if (= 185 (get-in entities [:room :entities :bloodclot :current-frame-index]))
(do (particle-effect! (get-in entities [:room :entities :grow-explode]) :reset)
(particle-effect! (get-in entities [:room :entities :grow-explode]) :start)))
(let [move-speed (* 0.17
(/ (:delta-time screen)
(/ 1.0 60.0)))
entities (update-in entities [:room :entities :ego :x] #(max 80 (- % move-speed)))]
(if (= 80 (get-in entities [:room :entities :ego :x]))
(update-in entities [:room :entities :ego] #(actions/start-animation screen % :crawl-hide))
entities )))
(continue [this screen entities]
(let [move-speed (* 0.17
(/ (:delta-time screen)
(/ 1.0 60.0)))
entities (update-in entities [:room :entities :ego :x] #(max 80 (- % move-speed)))]
entities))
(done? [this screen entities]
(= (get-in entities [:room :entities :bloodclot :current-frame-index]) 191))
(done? [this screen entities]
(> (- (:total-time screen) @start-time) 8.7))
(terminate [this screen entities]
(-> entities
(assoc-in [:tweens :flash] (tween/tween :flash screen [:white-fade :opacity] 0.0 1.0 0.2 :ease tween/ease-in-cubic))))
(skip-type [this screen entities]
:none))
(actions/run-action entities
(begin [this screen entities]
entities)
(terminate [this screen entities]
entities
)
(skip-type [this screen entities]
:none))))
(continue [this screen entities]
entities)
(done? [this screen entities]
(not (get-in entities [:tweens :flash])))
(terminate [this screen entities]
entities)
(skip-type [this screen entities]
:none))
(actions/run-action entities
(begin [this screen entities]
(assoc-in entities [:tweens :flash] (tween/tween :flash screen [:white-fade :opacity] 1.0 0.0 4.0 :ease tween/ease-in-cubic)))
(continue [this screen entities]
entities)
(done? [this screen entities]
(not (get-in entities [:tweens :flash])))
(terminate [this screen entities]
(update-in entities [:room :entities :ego] dissoc :stand-override))
(skip-type [this screen entities]
:none)))
(defn give-potion [entities]
(actions/do-dialogue entities
:ego "Hey, Bloodclot!"
@@ -139,12 +108,16 @@
:bloodclot-head "Ultimate power is mine!"
:bloodclot-head "If I drink this entire bottle, I'll be as powerful as a god!"
)
(actions/transition-music entities :tongue-fight)
(explode entities)
(actions/do-dialogue entities
:bloodclot "Now..."
:bloodclot "Where were we?")
(actions/talk entities :bloodclot "Now..."
:stop? false
:anim :big)
(actions/talk entities :bloodclot "Where were we?"
:stop? false
:anim :big)
(actions/transition-background entities :tongue-fight [141 110]))