going through the worflow.

This commit is contained in:
Bryce Covert
2018-01-25 22:44:01 -08:00
parent 2257276b97
commit 2bc541bf00
3 changed files with 97 additions and 85 deletions

View File

@@ -335,71 +335,7 @@
:default (actions/get-script entities
(actions/do-dialogue entities :frankie "What? Wanting to give up more of your goodies?"))})))
(defn explode [entities]
(actions/run-action entities
(begin [this screen entities]
(-> 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))))
(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 )))
(done? [this screen entities]
(= (get-in entities [:room :entities :bloodclot :current-frame-index]) 191))
(terminate [this screen entities]
(-> entities
(update-in [:room :entities] dissoc :bloodclot)
(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)
(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 disappear [entities]
(actions/run-action entities
(begin [this screen entities]
@@ -454,25 +390,13 @@
:none)))
(defn do-win [entities]
(actions/do-dialogue entities
:ego "Hey, Bloodclot!"
:ego "I have this potion which will make me as strong as you!"
:bloodclot-head "What?!"
:bloodclot-head "Give it here!")
(actions/transition-background entities :space [200 45] :between (fn [s e]
(-> e
(assoc-in [:room :entities :ego :stand-override] :crawl-stand)
(assoc-in [:room :entities :ego :previous-frame-index] -1)
(update-in [:room :entities :ego] #(actions/start-animation s % :crawl-stand)))
))
(actions/do-dialogue entities
:bloodclot-head "Yes!"
:bloodclot-head "Ultimate power is mine!"
:bloodclot-head "If I drink this entire bottle, I'll be as powerful as a god!")
(explode entities)
))
(actions/play-animation entities :ego :standup)
(Thread/sleep 1000)
(actions/update-entities entities (fn [e]