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

@@ -389,22 +389,16 @@
(skip-type [this screen entities]
:none)))
(defn do-win [entities]
(Thread/sleep 3000)
(actions/update-entities entities (fn [e]
(-> e
(assoc-in [:room :entities :penultimate :opacity] 1)
(assoc-in [:room :entities :penultimate-wall :opacity] 1)
(assoc-in [:cam :paused?] false)
(update-in [:room :entities :ego ] assoc :x 178 :y 166 :baseline 4)
(update-in [:room :entities] dissoc :tongue)
(update-in [:room :entities :ego] actions/start-animation :fall-small))))
(defn jump-away [entities]
(Thread/sleep 500)
(actions/run-action entities
(begin [this screen entities]
(-> entities
(assoc-in [:tweens :ego-x] (tween/tween :ego-x screen [:room :entities :ego :x] 178 153 0.5 :ease tween/ease-linear))
(assoc-in [:tweens :ego-y] (tween/tween :ego-y screen [:room :entities :ego :y] 166 186 0.5 :ease tween/ease-out-cubic))))
(assoc-in [:tweens :ego-x] (tween/tween :ego-x screen [:room :entities :ego :x] 200 163 0.5 :ease tween/ease-linear))
(assoc-in [:tweens :ego-y] (tween/tween :ego-y screen [:room :entities :ego :y] 166 186 0.5 :ease tween/ease-out-cubic))
(update-in [:room :entities :bloodclot-swallow-top] #(actions/start-animation screen % :swallow))
(update-in [:room :entities :bloodclot-swallow-bottom] #(actions/start-animation screen % :swallow))))
(continue [this screen entities]
entities)
(done? [this screen entities]
@@ -419,7 +413,7 @@
(begin [this screen entities]
(-> entities
(assoc-in [:tweens :ego-x] (tween/tween :ego-x screen [:room :entities :ego :x] 153 53 2 :ease tween/ease-linear))
(assoc-in [:tweens :ego-x] (tween/tween :ego-x screen [:room :entities :ego :x] 163 63 2 :ease tween/ease-linear))
(assoc-in [:tweens :ego-y] (tween/tween :ego-y screen [:room :entities :ego :y] 186 0 2 :ease tween/ease-in-cubic))))
(continue [this screen entities]
entities)
@@ -436,37 +430,126 @@
(-> e
(assoc-in [:room :entities :falling-bg :opacity] 1)
(assoc-in [:room :entities :sword-spin :opacity] 1))))
(Thread/sleep 2000))
(defn show-big-bloodclot [entities time]
(actions/update-entities entities (fn [e]
(-> e
(assoc-in [:room :entities :bloodclot-swallow-top :opacity] 1)
(assoc-in [:room :entities :bloodclot-swallow-bottom :opacity] 1)
(assoc-in [:room :entities :falling-ego :opacity] 0)
(assoc-in [:room :entities :sword-spin :opacity] 0)
(assoc-in [:room :entities :falling-bg :opacity] 0))))
(Thread/sleep time))
(defn fall-in [entities]
(Thread/sleep 500)
(actions/run-action entities
(begin [this screen entities]
(-> entities
(assoc-in [:tweens :ego-y] (tween/tween :ego-y screen [:room :entities :ego :y] 166 117 3.0 :ease tween/ease-out-cubic))
(update-in [:room :entities :bloodclot-swallow-top] #(actions/start-animation screen % :swallow))
(update-in [:room :entities :bloodclot-swallow-bottom] #(actions/start-animation screen % :swallow))))
(continue [this screen entities]
entities)
(done? [this screen entities]
(= 117 (get-in entities [:room :entities :ego :y])))
(terminate [this screen entities]
entities)
(skip-type [this screen entities]
:none))
(Thread/sleep 1500)
(actions/update-entities entities (fn [e]
(-> e
(assoc-in [:room :entities :falling-bg :opacity] 1)
(assoc-in [:room :entities :falling-ego :opacity] 1))))
(Thread/sleep 4000)
(show-big-bloodclot entities 1000)
(actions/update-entities entities (fn [e]
(-> e
(assoc-in [:room :entities :falling-bg :opacity] 0)
(assoc-in [:room :entities :sword-spin :opacity] 0))))
(assoc-in [:room :entities :falling-bg :opacity] 1)
(assoc-in [:room :entities :falling-ego :opacity] 0)
(assoc-in [:room :entities :sword-spin :opacity] 1))))
(Thread/sleep 2000))
(Thread/sleep 1000)
(defn do-win [entities won?]
(actions/fade entities 1.0 (fn [e]
(-> e
(assoc-in [:room :entities :penultimate :opacity] 1)
(assoc-in [:room :entities :penultimate-wall :opacity] 1)
(assoc-in [:room :entities :bloodclot-swallow-top :opacity] 1)
(assoc-in [:room :entities :bloodclot-swallow-bottom :opacity] 1)
(assoc-in [:cam :paused?] true)
(update-in [:room :entities :ego ] assoc :x 200 :y 166 :baseline 4)
(update-in [:room :entities] dissoc :tongue)
(update-in [:room :entities :ego] actions/start-animation :fall-small))))
(if won?
(jump-away entities)
(fall-in entities))
(show-big-bloodclot entities 1000)
(actions/update-entities entities (fn [e]
(-> e
(assoc-in [:room :entities :penultimate-black :opacity] 1))))
(update-in [:room :entities :sword-spin] assoc :opacity 1 :scale-x 0.5 :scale-y 0.5)
(assoc-in [:room :entities :falling-bg :opacity] 1)
(assoc-in [:room :entities :belly-bottom :opacity] 1)
(update-in [:room :entities :falling-bg ] dissoc :anim)
)))
(actions/tween entities :sword-fall (fn [screen entities]
(tween/tween :sword-fall screen [:room :entities :sword-spin :y] 240 120 1.5 :ease tween/ease-linear)))
(actions/update-entities entities (fn [e]
(-> e
(assoc-in [:room :entities :belly-bottom :opacity] 0))))
(show-big-bloodclot entities 0)
(actions/update-entities entities (fn [e]
(-> e
(update-in [:room :entities :bloodclot-swallow-top] #(actions/start-animation % :uhoh))
(update-in [:room :entities :bloodclot-swallow-bottom] #(actions/start-animation % :uhoh)))))
(Thread/sleep 2000)
(actions/update-entities entities (fn [e]
(-> e
(assoc-in [:room :entities :penultimate-black :opacity] 1)
(assoc-in [:cam :paused?] false)
(update-in [:room :entities :black-blowup] (fn [b]
(particle-effect! b :reset)
(particle-effect! b :start)
b)))))
(println "doing screen shake?")
(actions/camera-shake entities 15.0)
(actions/camera-shake entities 8.0)
(println "doing screen shake?")
(actions/transition-background entities :space [55 90] :time 6.0 :type :white-fade :between (fn [s e]
(-> e
(actions/transition-background entities :space [55 90]
:time 4.0
:transition-music? false
:type :white-fade
: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))
(update-in [:room :entities :ego] #(actions/start-animation s % :crawl-stand))
(update-in [:room :entities] dissoc :bloodclot-head)
(assoc-in [:room :entities :bloodclot-smoke] (get-in e [:room :bloodclot-smoke]))
(update-in [:room ] dissoc :broken-jewel)
(update-in [:room :entities :bloodclot] #(actions/start-animation s % :steam))
(update-in [:room :entities :ego] dissoc :stand-override :talk-override )
(update-in [:room :entities :grow-explode] (fn [g]
(particle-effect! g :reset)
(particle-effect! g :start)
g)))))
(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))
(update-in [:room :entities :ego] #(actions/start-animation s % :crawl-stand))
(update-in [:room :entities] dissoc :bloodclot-head)
(assoc-in [:room :entities :bloodclot-smoke] (get-in e [:room :bloodclot-smoke]))
(update-in [:room ] dissoc :broken-jewel)
(update-in [:room :entities :bloodclot] #(actions/start-animation s % :steam))
(update-in [:room :entities :ego] dissoc :stand-override :talk-override )
(update-in [:room :entities :grow-explode] (fn [g]
(particle-effect! g :reset)
(particle-effect! g :start)
g)))))
(Thread/sleep 2000)