changes
This commit is contained in:
@@ -153,14 +153,23 @@
|
||||
:x 144 :y 122 :baseline 139
|
||||
:script (actions/get-script entities
|
||||
(actions/walk-to entities :ego [168 76] :face :left)
|
||||
(actions/do-dialogue entities :ego "Awesome! I'll take this sword and become a knight.")
|
||||
(actions/talk entities :ego "There's a plaque here.")
|
||||
(actions/play-animation entities :ego :squat)
|
||||
(actions/do-dialogue entities
|
||||
:ego "'A noble choice to be a knight,\nBe a hero, do what's right.'"
|
||||
:ego "'There's no need to shove,\nTo find your true love,'"
|
||||
:ego "'Because maidens love guys with might.'"
|
||||
:ego "Awesome!"
|
||||
:ego "If I become a knight, maybe Georgia McGorgeous will love me!")
|
||||
(actions/stop-walking entities :ego :face :right)
|
||||
(actions/do-dialogue entities
|
||||
:fairy-godfather "Tick, I'm not sure that being a knight is right for you."
|
||||
:fairy-godfather "I think you'd be better suited for a more menial job."
|
||||
:ego "Hey! Why can't I be a knight! It's my destiny!"
|
||||
:ego "And plus, knights get all the chicks!"
|
||||
:ego "And this plaque here says that chicks dig knights.")))
|
||||
:fairy-godfather "Tick, I told you that you can't be a knight."
|
||||
:fairy-godfather "I think you'd be much better suited for a more menial job."
|
||||
:ego "Hey! Why can't I be a knight? It's my destiny!"
|
||||
:ego "And plus, it's the only way to get Georgia McGorgeous to love me!"
|
||||
:ego "And this plaque here says that maidens love knights."
|
||||
:fairy-godfather "As long as you're under my watch, Tick, I forbid it!"
|
||||
:fairy-godfather "And you're just not cut out for it!")))
|
||||
:broom (assoc (texture "dream/broom.png") :x 286 :y 122
|
||||
:path (catmull-rom-spline (map #(apply vector-2* %) [[286 122] [286 128]]) true)
|
||||
|
||||
@@ -168,7 +177,14 @@
|
||||
:baseline 240
|
||||
:script (actions/get-script entities
|
||||
(actions/walk-to entities :ego [267 70] :face :right)
|
||||
(actions/talk entities :ego "So do I kill ghouls with this broom?")
|
||||
(actions/talk entities :ego "There's a plaque here.")
|
||||
(actions/play-animation entities :ego :squat)
|
||||
(actions/do-dialogue entities
|
||||
:ego "'Grab the broom, and sweep that dirt!\nSweep, and mop till your arms hurt.'"
|
||||
:ego "'You'll smell like a hog,\nwith stench like a fog,'"
|
||||
:ego "'So with you, no girl will flirt.'")
|
||||
(actions/play-animation entities :ego :sigh)
|
||||
(actions/talk entities :ego "So can I at least slay ghouls with this broom?")
|
||||
(actions/stop-walking entities :ego :face :left)
|
||||
(actions/do-dialogue entities :fairy-godfather "Not quite, young Tick."
|
||||
:fairy-godfather "This weapon is used to fight a more persistent foe."
|
||||
@@ -182,11 +198,17 @@
|
||||
:baseline 240
|
||||
:script (actions/get-script entities
|
||||
(actions/walk-to entities :ego [61 72] :face :left)
|
||||
(actions/talk entities :ego "A shovel?")
|
||||
(actions/stop-walking entities :ego :face :right)
|
||||
(actions/do-dialogue entities :fairy-godfather "That's right, young Tick!"
|
||||
:fairy-godfather "A grave-digger is a noble profession!"
|
||||
:fairy-godfather "Take the shovel, and cast it into the pit of fate.")))
|
||||
(actions/talk entities :ego "There's a plaque here.")
|
||||
(actions/play-animation entities :ego :squat)
|
||||
(actions/do-dialogue entities
|
||||
:ego "'Choose the shovel, dig some holes,\ntis the boringest of roles,'"
|
||||
:ego "'You can work by night,\nBut suffer a plight:'"
|
||||
:ego "'Gals dislike guys who bury souls.'")
|
||||
(actions/play-animation entities :ego :sigh)
|
||||
(actions/do-dialogue entities
|
||||
:fairy-godfather "Don't be dismayed, young Tick."
|
||||
:fairy-godfather "Remember, these destinies can't be mistaken."
|
||||
:ego "But it sounds so dull!")))
|
||||
:sign (assoc (texture "dream/sign.png") :x 229 :y 33 :baseline 207)
|
||||
:fairy-godfather (assoc (animation->texture screen fairy-godfather-anim)
|
||||
:x 200 :y 130
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
[advent.screens.rooms.outside-castle :as outside-castle]
|
||||
[advent.screens.rooms.inside-castle :as inside-castle]
|
||||
[advent.actions :as actions]
|
||||
[advent.tween :as tween]
|
||||
[advent.utils :as utils]
|
||||
[clojure.zip :as zip]
|
||||
[play-clj.core :refer :all]
|
||||
@@ -256,6 +257,78 @@
|
||||
(assoc-in entities [:room :entities :lamb :target-x] (rand-nth [30 10 60 70]))
|
||||
entities)))
|
||||
|
||||
|
||||
(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.3 :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)))
|
||||
|
||||
(defn make [screen]
|
||||
(let [sheep-stand-sheet (texture! (texture "outsidehouse/sheep-anim.png") :split 33 21)
|
||||
sheep-walk-sheet (texture! (texture "outsidehouse/sheep-walk.png") :split 33 21)
|
||||
@@ -339,7 +412,8 @@
|
||||
(actions/talk entities :ego "I guess her wool is shedding."))
|
||||
(do
|
||||
(actions/talk entities :ego "Come here mama sheep!")
|
||||
(actions/play-animation entities :ego :sigh)
|
||||
(glad entities)
|
||||
|
||||
(actions/talk entities :ego "She's too far away for me to pet her.")))))
|
||||
:scripts #(condp = %
|
||||
:wool (actions/get-script entities
|
||||
|
||||
@@ -197,6 +197,7 @@
|
||||
scared-talk (utils/make-anim "ego/scared.png" [18 36] 0.05 [0 1 0 1 0 1 0 1 2 3 2 3 2 3 2 3])
|
||||
scared-walk (utils/make-anim "ego/scared-walk.png" [16 36] 0.05 (range 6))
|
||||
sigh (utils/make-anim "ego/sigh.png" [18 36] 0.08 [0 0 0 0 1 1 1 2 3 4 5 6 7 8 8 8 8 8 8 8 8 8 0 0 0 0 ])
|
||||
glad (utils/make-anim "ego/glad.png" [20 46] 0.04 (flatten [0 1 2 3 4 (repeat 10 [5 5 6]) (repeat 20 0)]))
|
||||
|
||||
ego {:right {:walk walk-right
|
||||
:stand stand-anim
|
||||
@@ -231,7 +232,8 @@
|
||||
:scared scared
|
||||
:scared-talk scared-talk
|
||||
:scared-walk scared-walk
|
||||
:sigh sigh}
|
||||
:sigh sigh
|
||||
:glad glad}
|
||||
:left {:walk (utils/flip walk-right)
|
||||
:stand (utils/flip stand-anim)
|
||||
:talk (utils/flip talk-anim)
|
||||
@@ -256,7 +258,8 @@
|
||||
[:fire 3] (utils/flip fire-3-anim)
|
||||
:spear (utils/flip spear)
|
||||
:pant (utils/flip pant)
|
||||
:sigh (utils/flip sigh)}
|
||||
:sigh (utils/flip sigh)
|
||||
:glad (utils/flip glad)}
|
||||
:baseline (- 240 (last start-pos))
|
||||
:facing :right
|
||||
:origin-x 9
|
||||
|
||||
@@ -35,6 +35,14 @@
|
||||
(- (* t t t t) 2))
|
||||
start)))))
|
||||
|
||||
(defn ease-out-quadratic [t start delta duration]
|
||||
(let [t (/ t duration)]
|
||||
(+ (* (- delta) t (- t 2)) start)))
|
||||
|
||||
(defn ease-out-cubic [t start delta duration]
|
||||
(let [t (dec (/ t duration))]
|
||||
(+ (* delta (inc (* t t t))) start)))
|
||||
|
||||
(defn tween [id screen path start end duration & {:keys [finish ease]}]
|
||||
(let [ease (or ease ease-linear)
|
||||
finish (or finish identity)
|
||||
|
||||
Reference in New Issue
Block a user