more grandma refinement.
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
[play-clj.utils :refer :all]
|
||||
[play-clj.g2d :refer :all]))
|
||||
(defn get-down [entities]
|
||||
(actions/talk entities :ego "I'll get down.")
|
||||
|
||||
(actions/walk-straight-to entities :ego [151 50] :update-baseline? false :face :left)
|
||||
(actions/play-animation entities :ego :reach)
|
||||
(actions/remove-entity entities :blank)
|
||||
@@ -23,9 +23,10 @@
|
||||
cat-walk (animation 0.2 [(texture "cat-tree/pounce.png")])
|
||||
ladder-entity (assoc (texture "inside-cafeteria/ladder.png") :x 120 :y 60 :baseline 162)
|
||||
grandma-stand (utils/make-anim "cat-tree/grandma.png" [25 36] 0.2 [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1])
|
||||
grandma-cat-stand (utils/make-anim "cat-tree/grandma.png" [25 36] 0.2 [6 6 6 6 6 6 6 6 6 6 6 6 6 6 7])
|
||||
grandma-squat (utils/make-anim "cat-tree/grandma.png" [25 36] 0.2 [3 4 5 4 3])
|
||||
grandma-talk (utils/make-anim "cat-tree/grandma.png" [25 36] 0.2 [0 2 0 2 0 2 0 2 0 2 0 1 0 2 0 0])]
|
||||
grandma-squat-1 (utils/make-anim "cat-tree/grandma.png" [25 36] 0.2 [3 4 5 5 5 5 5])
|
||||
grandma-squat-2 (utils/make-anim "cat-tree/grandma.png" [25 36] 0.2 [5 5 4 3])
|
||||
grandma-talk (utils/make-anim "cat-tree/grandma.png" [25 36] 0.2 [0 2 0 2 0 2 0 2 0 2 0 1 0 2 0 0])
|
||||
grandma-kiss (utils/make-anim "cat-tree/grandma.png" [25 36] 0.2 [0 8 9 10 9 10 9 10 9 8 0])]
|
||||
(rooms/make :music :town-2
|
||||
:interactions
|
||||
{:down-dir {:box [150 0 270 20]
|
||||
@@ -46,6 +47,7 @@
|
||||
{:object nil :x 0 :y 0 :width 320 :height 240 :baseline 240
|
||||
:script (actions/get-script entities
|
||||
(when (get-in @entities [:room :entities :ladder])
|
||||
(actions/talk entities :ego "I'll get down.")
|
||||
(get-down entities)))}))
|
||||
)}}
|
||||
:grass {:box [26 105 60 160]
|
||||
@@ -72,20 +74,27 @@
|
||||
(if (get-in @entities [:room :entities :ladder])
|
||||
(do (actions/talk entities :ego "I think he's going for it!")
|
||||
(actions/play-animation entities :ego :cat-toy-first-half :stop? false)
|
||||
(sound! (sound "cat-tree/cat.ogg") :play)
|
||||
(actions/walk-straight-to entities :cat [138 40] :update-baseline? false :speed 3)
|
||||
(actions/play-animation entities :ego :cat-toy-last-half)
|
||||
(swap! entities #(assoc-in % [:room :entities :grandma :stand]
|
||||
(get-in % [:room :entities :grandma :cat-stand])))
|
||||
(actions/play-animation entities :grandma :squat)
|
||||
(actions/play-animation entities :grandma :squat-1 :stop? false)
|
||||
(actions/remove-entity entities :cat)
|
||||
(actions/play-animation entities :grandma :squat-2)
|
||||
(actions/do-dialogue entities :grandma "Thank you for rescuing my furry friend, young man!")
|
||||
(get-down entities)
|
||||
(actions/walk-straight-to entities :ego [165 45] :face :left)
|
||||
(actions/do-dialogue entities
|
||||
:grandma "Thank you for rescuing my furry friend, young man!"
|
||||
:ego "It's nothing."
|
||||
:grandma "You are so brave!"
|
||||
:grandma "Here's a certificate of bravery!")
|
||||
(actions/talk entities :ego "TODO: get award from little old lady in this room")
|
||||
(actions/give entities :certificate))
|
||||
:ego "It's no big deal."
|
||||
:grandma "You won't go unrewarded!"
|
||||
:grandma "Come here young man.")
|
||||
(actions/walk-straight-to entities :ego [133 35])
|
||||
(actions/talk entities :grandma "For your impressive display of courage and bravery, I give you this. ")
|
||||
(sound! (sound "cat-tree/kiss.ogg") :play)
|
||||
(actions/play-animation entities :grandma :kiss)
|
||||
(actions/give entities :kiss)
|
||||
(actions/play-animation entities :ego :get-sick :stop? false)
|
||||
(actions/walk-straight-to entities :ego [165 45])
|
||||
(actions/talk entities :ego "Ugh! Gross!"))
|
||||
(actions/talk entities :ego "I guess I'm too far away.")))})
|
||||
cat-stand)
|
||||
:grandma (assoc (animation->texture screen grandma-stand)
|
||||
@@ -93,9 +102,10 @@
|
||||
:anim grandma-stand
|
||||
:anim-start 0
|
||||
:talk grandma-talk
|
||||
:cat-stand grandma-cat-stand
|
||||
:kiss grandma-kiss
|
||||
:stand grandma-stand
|
||||
:squat grandma-squat
|
||||
:squat-1 grandma-squat-1
|
||||
:squat-2 grandma-squat-2
|
||||
:origin-x 12
|
||||
:origin-y 0
|
||||
:scale-x 1.45
|
||||
@@ -104,7 +114,7 @@
|
||||
:scale-fn (utils/scaler-fn-with-baseline 110 0.10 1.20)
|
||||
:apply-state (fn [entities]
|
||||
(as-> entities entities
|
||||
(if (actions/has-item? entities :certificate)
|
||||
(if (actions/has-item? entities :kiss)
|
||||
(update-in entities [:room :entities] #(dissoc % :cat))
|
||||
entities)))
|
||||
:start-pos [203 1])))
|
||||
|
||||
Reference in New Issue
Block a user