improving font.
This commit is contained in:
@@ -651,3 +651,73 @@
|
||||
(defn respond [entities line & more]
|
||||
(apply do-dialogue entities :ego line more))
|
||||
|
||||
(defn glad [entities]
|
||||
(actions/run-action entities
|
||||
(begin [this screen entities]
|
||||
(let [current-y (get-in entities [:room :entities :ego :y])
|
||||
to-y (+ current-y 15)]
|
||||
(-> entities
|
||||
(update-in [:room :entities :ego] #(actions/start-animation screen % :glad) )
|
||||
(assoc-in [:tweens :jump] (tween/tween :jump screen [:room :entities :ego :y] current-y to-y 0.3 :ease tween/ease-out-cubic))
|
||||
(assoc-in [:room :entities :glad-jump] (doto (assoc (particle-effect "ego/glad-jump")
|
||||
:x (get-in entities [:room :entities :ego :x])
|
||||
:y (get-in entities [:room :entities :ego :y])
|
||||
:baseline (get-in entities [:room :entities :ego :baseline]))
|
||||
(particle-effect! :reset) (particle-effect! :start)))
|
||||
(assoc-in [:room :entities :cloud] (assoc (texture "space/cloud.png")
|
||||
:x (get-in entities [:room :entities :ego :x])
|
||||
:y (get-in entities [:room :entities :ego :y])
|
||||
:origin-x 7
|
||||
:origin-y 7
|
||||
:scale-x 0.5
|
||||
:scale-y 0.5
|
||||
:opacity 0.5
|
||||
:baseline 240))
|
||||
(assoc-in [:tweens :cloud-up] (tween/tween :cloud-up screen [:room :entities :cloud :y]
|
||||
(get-in entities [:room :entities :ego :y])
|
||||
(+ (get-in entities [:room :entities :ego :y]) 10)
|
||||
1.0))
|
||||
(assoc-in [:tweens :cloud-fade] (tween/tween :cloud-fade screen [:room :entities :cloud :opacity]
|
||||
0.5
|
||||
0.0
|
||||
1.0))
|
||||
(assoc-in [:tweens :cloud-grow] (tween/tween :cloud-grow screen [:room :entities :cloud :scale-y]
|
||||
0.5
|
||||
1.0
|
||||
1.0))
|
||||
(assoc-in [:tweens :cloud-grow-2] (tween/tween :cloud-grow-2 screen [:room :entities :cloud :scale-x]
|
||||
0.5
|
||||
1.0
|
||||
1.0)))))
|
||||
|
||||
(continue [this screen entities]
|
||||
(assoc-in entities [:room :entities :glad-jump :y] (+ (get-in entities [:room :entities :ego :y]) 5))
|
||||
)
|
||||
|
||||
(done? [this screen entities]
|
||||
(nil? (get-in entities [:tweens :jump])))
|
||||
|
||||
(terminate [this screen entities]
|
||||
entities)
|
||||
(can-skip? [this screen entities]
|
||||
false))
|
||||
(Thread/sleep 800)
|
||||
(actions/run-action entities
|
||||
(begin [this screen entities]
|
||||
(let [current-y (get-in entities [:room :entities :ego :y])
|
||||
to-y (- current-y 15)]
|
||||
(-> entities
|
||||
(assoc-in [:tweens :jump] (tween/tween :jump screen [:room :entities :ego :y] current-y to-y 0.1 :ease tween/ease-in-cubic)))))
|
||||
|
||||
(continue [this screen entities] entities)
|
||||
|
||||
(done? [this screen entities]
|
||||
(and (nil? (get-in entities [:tweens :jump]))
|
||||
(animation! (actions/find-animation (get-in entities [:room :entities :ego ]) :glad)
|
||||
:is-animation-finished
|
||||
(- (:total-time screen) (get-in entities [:room :entities :ego :anim-start])))))
|
||||
|
||||
(terminate [this screen entities]
|
||||
entities)
|
||||
(can-skip? [this screen entities]
|
||||
false)))
|
||||
|
||||
Reference in New Issue
Block a user