diff --git a/desktop/resources/cursor.png b/desktop/resources/cursor.png index 20ebbf60..ded42686 100644 Binary files a/desktop/resources/cursor.png and b/desktop/resources/cursor.png differ diff --git a/desktop/src-common/advent/screens/items.clj b/desktop/src-common/advent/screens/items.clj index 04fbf841..7dbdc055 100644 --- a/desktop/src-common/advent/screens/items.clj +++ b/desktop/src-common/advent/screens/items.clj @@ -72,3 +72,4 @@ (def medal {:name "Medal of strength" :value :medal :cursor :medal}) +(def certificate {:name "Certificate of courage" :value :certificate :cursor :certificate}) diff --git a/desktop/src-common/advent/screens/rooms/cat_tree.clj b/desktop/src-common/advent/screens/rooms/cat_tree.clj index 8a51548b..432f5539 100644 --- a/desktop/src-common/advent/screens/rooms/cat_tree.clj +++ b/desktop/src-common/advent/screens/rooms/cat_tree.clj @@ -8,6 +8,13 @@ [play-clj.ui :refer :all] [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) + (actions/remove-entity entities :ladder) + (actions/give entities items/ladder)) (defn make [screen] (let [cat-stand-sheet (texture! (texture "cat-tree/cat-stand.png") :split 22 10) @@ -34,7 +41,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)))})) )}}} :layers [(assoc (texture "cat-tree/background.png") :x 0 :y 0 :baseline 0) (assoc (texture "cat-tree/tree-and-rock.png") :x 0 :y 0 :baseline 161) @@ -47,7 +54,14 @@ (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."))}) + (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/remove-entity entities :cat) + (get-down entities) + (actions/talk entities :ego "TODO: get award from little old lady in this room") + (actions/give entities items/certificate)) + (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 e668591d..42a65329 100644 --- a/desktop/src-common/advent/screens/scene.clj +++ b/desktop/src-common/advent/screens/scene.clj @@ -226,7 +226,7 @@ :inside-fangald (make-music "inside-fangald.ogg")} :state {:object nil :active? true - :inventory [items/grass items/ladder] + :inventory [items/grass ] :clues #{} :mints-eaten 0} :actions {:object nil diff --git a/desktop/src-common/advent/utils.clj b/desktop/src-common/advent/utils.clj index 32a47d84..7b4488e1 100644 --- a/desktop/src-common/advent/utils.clj +++ b/desktop/src-common/advent/utils.clj @@ -11,7 +11,7 @@ (let [{:keys [x y]} (input->screen screen {:x (:input-x screen) :y (:input-y screen)})] (println (:input-x screen) (:input-y screen) "->" x y))) -(def +all-cursors+ [:main :wool :mushrooms :carrot :right :down :left :up :flask :flask-with-contents :trophy :ladder :stick :cat-toy :balloon :frog-legs :teddy :portrait :recipe :glass-eye :motivational-tapes :used-earplugs :grass :slobber :flask-with-strength :medal]) +(def +all-cursors+ [:main :wool :mushrooms :carrot :right :down :left :up :flask :flask-with-contents :trophy :ladder :stick :cat-toy :balloon :frog-legs :teddy :portrait :recipe :glass-eye :motivational-tapes :used-earplugs :grass :slobber :flask-with-strength :medal :certificate]) (defn cursor [filename which] (let [scale 2