From e4005245c61872d4c8b9e33e5c6988c32c9d2cbd Mon Sep 17 00:00:00 2001 From: Remington Covert Date: Sat, 1 Nov 2014 13:01:05 -0700 Subject: [PATCH] added cat toy. --- desktop/src-common/advent/screens/rooms/cat_tree.clj | 5 ++++- desktop/src-common/advent/screens/scene.clj | 9 +++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/desktop/src-common/advent/screens/rooms/cat_tree.clj b/desktop/src-common/advent/screens/rooms/cat_tree.clj index da8b25ac..c383ac2c 100644 --- a/desktop/src-common/advent/screens/rooms/cat_tree.clj +++ b/desktop/src-common/advent/screens/rooms/cat_tree.clj @@ -27,7 +27,10 @@ :x 184 :y 173 :baseline 240 :script (actions/get-script entities (actions/talk entities :ego "Here kitty, kitty, kitty.") - (actions/talk entities :ego "Kitty's not so interested in me."))) + (actions/talk entities :ego "Kitty's not so interested in me.")) + :scripts {:cat-toy (actions/get-script entities + (actions/play-animation entities :ego :cat-toy) + (actions/talk entities :ego "I guess I'm too far away."))}) cat-stand)} :collision "cat-tree/collision.png" :scale-fn (utils/scaler-fn-with-baseline 110 0.10 1.20)))) diff --git a/desktop/src-common/advent/screens/scene.clj b/desktop/src-common/advent/screens/scene.clj index 30abec78..5e58b222 100644 --- a/desktop/src-common/advent/screens/scene.clj +++ b/desktop/src-common/advent/screens/scene.clj @@ -81,6 +81,7 @@ stand-sheet (texture! (texture "ego/stand.png") :split 18 36) squat-sheet (texture! (texture "ego/squat.png") :split 18 36) reach-sheet (texture! (texture "ego/reach.png") :split 18 36) + cat-toy-sheet (texture! (texture "ego/cat-toy.png") :split 41 50) walk-right (animation 0.075 (for [i (range 8)] (texture (aget player-sheet 0 i)))) stand-anim (animation 0.1 (for [i (flatten [(repeat 6 [(repeat 10 0) (repeat 3 1) (repeat 20 0)]) 3 4 5 5 5 6 5 6 5 6 5 4 3 ])] @@ -91,16 +92,20 @@ (texture (aget squat-sheet 0 i)))) reach-anim (animation 0.1 (for [i [0 1 2 3 3 3 3 3 3 2 1 0]] (texture (aget reach-sheet 0 i)))) + cat-toy-anim (animation 0.1 (for [i [0 0 1 1 2 2 3 4 3 2 3 4 3 2 3 4 3 2 3 4 3 2 2 1 1 0 0]] + (texture (aget cat-toy-sheet 0 i)))) ego {:right {:walk walk-right :stand stand-anim :talk talk-anim :squat squat-anim - :reach reach-anim} + :reach reach-anim + :cat-toy cat-toy-anim} :left {:walk (utils/flip walk-right) :stand (utils/flip stand-anim) :talk (utils/flip talk-anim) :squat (utils/flip squat-anim) - :reach (utils/flip reach-anim)} + :reach (utils/flip reach-anim) + :cat-toy (utils/flip cat-toy-anim)} :baseline 95 :facing :right :origin-x 9