This commit is contained in:
2014-12-11 21:23:08 -08:00
parent 53b7efb6a4
commit 3572a09227
16 changed files with 80 additions and 5 deletions

View File

@@ -20,7 +20,12 @@
(let [cat-stand-sheet (texture! (texture "cat-tree/cat-stand.png") :split 22 10)
cat-stand (animation 0.15 (for [i (flatten [(repeat 10 0) 1 1 (repeat 10 0) 2 3 4 3 0 0 2 3 4 3 (repeat 10 0) 1 1 (repeat 10 0) 5 5 6 6 7 (repeat 10 [7 8]) 6 5 0])]
(aget cat-stand-sheet 0 i)))
ladder-entity (assoc (texture "inside-cafeteria/ladder.png") :x 120 :y 60 :baseline 162)]
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])]
(rooms/make :music :town-2
:interactions
{:down-dir {:box [150 0 270 20]
@@ -57,6 +62,8 @@
:entities {:cat (actions/start-animation screen
(assoc (animation->texture screen cat-stand)
:x 184 :y 173 :baseline 1000
:walk cat-walk
:stand cat-stand
:script (actions/get-script entities
(actions/talk entities :ego "Here kitty, kitty, kitty.")
(actions/talk entities :ego "Kitty's not so interested in me."))
@@ -64,13 +71,35 @@
(actions/play-animation entities :ego :cat-toy)
(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)
(actions/play-animation entities :ego :cat-toy-first-half :stop? false)
(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/remove-entity entities :cat)
(get-down entities)
(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))
(actions/talk entities :ego "I guess I'm too far away.")))})
cat-stand)}
cat-stand)
:grandma (assoc (animation->texture screen grandma-stand)
:x 130 :y 37 :baseline 200
:anim grandma-stand
:anim-start 0
:talk grandma-talk
:cat-stand grandma-cat-stand
:stand grandma-stand
:squat grandma-squat
:origin-x 12
:origin-y 0
:scale-x 1.45
:scale-y 1.45)}
:collision "cat-tree/collision.png"
:scale-fn (utils/scaler-fn-with-baseline 110 0.10 1.20)
:apply-state (fn [entities]