diff --git a/desktop/resources/inside-antique/background.png b/desktop/resources/inside-antique/background.png index f0791a5c..44457cb6 100644 Binary files a/desktop/resources/inside-antique/background.png and b/desktop/resources/inside-antique/background.png differ diff --git a/desktop/resources/inside-antique/background.psd b/desktop/resources/inside-antique/background.psd index 8644a45f..89d01e75 100644 Binary files a/desktop/resources/inside-antique/background.psd and b/desktop/resources/inside-antique/background.psd differ diff --git a/desktop/resources/inside-antique/beard.png b/desktop/resources/inside-antique/beard.png index a52e37bc..02b34d39 100644 Binary files a/desktop/resources/inside-antique/beard.png and b/desktop/resources/inside-antique/beard.png differ diff --git a/desktop/resources/inside-antique/clock.pxa/0.pxi b/desktop/resources/inside-antique/clock.pxa/0.pxi new file mode 100644 index 00000000..5a733f1e Binary files /dev/null and b/desktop/resources/inside-antique/clock.pxa/0.pxi differ diff --git a/desktop/resources/inside-antique/clock.pxa/1.pxi b/desktop/resources/inside-antique/clock.pxa/1.pxi new file mode 100644 index 00000000..4c58a316 Binary files /dev/null and b/desktop/resources/inside-antique/clock.pxa/1.pxi differ diff --git a/desktop/resources/inside-antique/clock.pxa/2.pxi b/desktop/resources/inside-antique/clock.pxa/2.pxi new file mode 100644 index 00000000..0c3310ff Binary files /dev/null and b/desktop/resources/inside-antique/clock.pxa/2.pxi differ diff --git a/desktop/resources/inside-antique/clock.pxa/CelData.plist b/desktop/resources/inside-antique/clock.pxa/CelData.plist new file mode 100644 index 00000000..4749afb9 --- /dev/null +++ b/desktop/resources/inside-antique/clock.pxa/CelData.plist @@ -0,0 +1,18 @@ + + + + + + duration + 1 + + + duration + 1 + + + duration + 1 + + + diff --git a/desktop/resources/inside-antique/collision.png b/desktop/resources/inside-antique/collision.png index 3c5b6278..2d896de3 100644 Binary files a/desktop/resources/inside-antique/collision.png and b/desktop/resources/inside-antique/collision.png differ diff --git a/desktop/resources/outsidehouse/background.psd b/desktop/resources/outsidehouse/background.psd index 3342ac15..0abab352 100644 Binary files a/desktop/resources/outsidehouse/background.psd and b/desktop/resources/outsidehouse/background.psd differ diff --git a/desktop/src-common/advent/screens/rooms/inside_antique.clj b/desktop/src-common/advent/screens/rooms/inside_antique.clj index d74ce0ae..577ced73 100644 --- a/desktop/src-common/advent/screens/rooms/inside_antique.clj +++ b/desktop/src-common/advent/screens/rooms/inside_antique.clj @@ -91,22 +91,22 @@ shopkeep-talk (animation 0.15 (for [i [0 2 0 2 0 3 1 0]] (aget shopkeep-sheet 0 i))) portrait (rooms/make-entity :portrait (assoc (texture "inside-antique/portrait.png") - :x 109 - :y 120 + :x 112 + :y 114 :baseline 120 :script (actions/get-script entities - (actions/walk-to entities :ego [136 80] :face :left) + (actions/walk-to entities :ego [140 61] :face :left) (actions/play-animation entities :ego :reach) (actions/talk entities :ego "It's a portrait. There's something on the back but I can't read it.") (actions/remove-entity entities :portrait) (actions/give entities :portrait)))) - beard (utils/make-anim "inside-antique/beard.png" [12 32] 0.5 [0 1 0 2]) + beard (utils/make-anim "inside-antique/beard.png" [26 52] 0.5 [0 1 0 2]) teddy (assoc (texture "inside-antique/teddy.png") - :x 250 - :y 80 + :x 255 + :y 95 :baseline 160 :script (actions/get-script entities - (actions/walk-to entities :ego [220 35] :face :right) + (actions/walk-to entities :ego [242 49] :face :right) (actions/play-animation entities :ego :reach) (actions/give entities :teddy) (actions/remove-entity entities :teddy) @@ -117,48 +117,49 @@ :shopkeep "That teddy bear does not leave my store."))))] (rooms/make :music :inside-antique :interactions - {:down {:box [60 0 290 25] - :cursor :down + {:right {:box [250 0 320 75] + :cursor :right :script (actions/get-script entities (when (or (actions/has-item? entities :portrait) (has-to-return-teddy? entities)) - (actions/walk-to entities :ego [222 3]) + (actions/walk-to entities :ego [235 15]) (actions/talk entities :shopkeep "Excuse me sonny. Please return my belongings before you leave.") (when (actions/has-item? entities :portrait) - (actions/walk-to entities :ego [136 80] :face :left) + (actions/walk-to entities :ego [143 64] :face :left) (actions/play-animation entities :ego :reach) (actions/add-entity entities :portrait portrait) (actions/remove-item entities :portrait)) (when (has-to-return-teddy? entities) - (actions/walk-to entities :ego [220 35] :face :right) + (actions/walk-to entities :ego [242 49] :face :right) (actions/play-animation entities :ego :reach) (actions/add-entity entities :teddy teddy) (actions/remove-item entities :teddy))) - (actions/walk-to entities :ego [222 3]) + (actions/walk-to entities :ego [235 15]) + (actions/walk-straight-to entities :ego [320 -5]) (actions/transition-background entities :inside-castle [182 90]) (actions/walk-to entities :ego [187 75]))} - :window {:box [212 130 256 180] + :window {:box [210 125 256 183] :script (actions/get-script entities (actions/talk entities :ego "It's a nice, big window.")) :scripts {:portrait (actions/get-script entities - (actions/walk-to entities :ego [151 60] :face :right) + (actions/walk-to entities :ego [142 49] :face :left) (actions/play-animation entities :ego :hold-up-to-window) (actions/talk entities :ego "The portrait says 'Herb' on the back.") (actions/update-state entities (fn [state] (update-in state [:clues] #(conj % :name)) )))}} - :grandfather-clock {:box [50 137 90 185] + :grandfather-clock {:box [55 70 103 185] :script (actions/get-script entities (actions/do-dialogue entities :ego "Cool grandfather clock!" :shopkeep "It's quite the exquisit piece, isn't it?"))} - :shelf {:box [0 40 48 210] + :shelf {:box [0 60 52 199] :script (actions/get-script entities - (actions/walk-to entities :ego [55 35]) + (actions/walk-to entities :ego [48 58]) (actions/talk entities :ego "All of these trinkets seem too bulky to fit in my pack."))} - :flowers {:box [171 125 181 155] + :flowers {:box [178 115 188 143] :script (actions/get-script entities (actions/update-state entities (fn [s] (assoc s :mints-eaten 0))) (actions/talk entities :ego "I've never been a fan of flowers."))} - :lian {:box [272 100 313 160] + :lian {:box [264 103 317 198] :script (actions/get-script entities (actions/walk-to entities :ego [220 35] :face :right) (actions/do-dialogue entities @@ -166,8 +167,10 @@ :ego "He's the town of Remington's mascot."))} } :layers [(assoc (texture "inside-antique/background.png") :x 0 :y 0 :baseline 0)] - :entities {:shopkeep (actions/start-animation screen (assoc (animation->texture screen shopkeep-stand) :x 137 :y 128 :baseline 112 + :entities {:shopkeep (actions/start-animation screen (assoc (animation->texture screen shopkeep-stand) :x 148 :y 122 :baseline 112 :stand shopkeep-stand + :scale-x 1.6 + :scale-y 1.6 :talk-color (color 0.2 1.0 0.2 1.0) :talk shopkeep-talk :script (actions/get-script entities (do-antique-dialogue entities)) @@ -190,20 +193,20 @@ :beard (assoc (animation->texture screen beard) :anim beard :anim-start 0 - :x 65 - :y 109 + :x 70 + :y 86 :baseline 120) :bowl (assoc (texture "inside-antique/bowl.png") - :x 155 - :y 125 + :x 165 + :y 110 :baseline 125 :script (actions/get-script entities (if (= 3 (get-in @entities [:state :mints-eaten])) - (do (actions/walk-to entities :ego [145 80] :face :right) + (do (actions/walk-to entities :ego [159 62] :face :right) (actions/do-dialogue entities :ego "She's all out." :ego "Maybe Gandarf can brew her up another batch.")) - (do (actions/walk-to entities :ego [145 80] :face :right) + (do (actions/walk-to entities :ego [159 62] :face :right) (actions/talk entities :ego "I'll just try one of these mints.") (actions/play-animation entities :ego :reach) (actions/update-state entities (fn [s] (assoc s :mints-eaten (inc (s :mints-eaten))))) @@ -224,5 +227,5 @@ (if (actions/has-item? entities :portrait ) (update-in entities [:room :entities] #(dissoc % :portrait)) entities))) - :scale-fn (utils/scaler-fn-with-baseline 110 0.10 1.50) + :scale-fn (utils/scaler-fn-with-baseline 110 0.10 1.75) :start-pos [222 3]))) diff --git a/desktop/src-common/advent/screens/rooms/inside_castle.clj b/desktop/src-common/advent/screens/rooms/inside_castle.clj index 997f5a2b..1c9bff62 100644 --- a/desktop/src-common/advent/screens/rooms/inside_castle.clj +++ b/desktop/src-common/advent/screens/rooms/inside_castle.clj @@ -240,8 +240,8 @@ (actions/play-animation entities :ego :reach) (if (= :night (get-in @entities [:state :time])) (actions/talk entities :ego "It's locked.") - (do (actions/transition-background entities :inside-antique [228 -30]) - (actions/walk-straight-to entities :ego [222 15] :face :left) + (do (actions/transition-background entities :inside-antique [325 -30]) + (actions/walk-straight-to entities :ego [235 15] :face :left) (if (get-in @entities [:state :allowed-to-keep-teddy?]) (actions/do-dialogue entities :shopkeep "Hello there, sonny." :shopkeep "Have you seen Herb lately?" diff --git a/desktop/src-common/advent/screens/scene.clj b/desktop/src-common/advent/screens/scene.clj index 82c8f411..3c3acabf 100644 --- a/desktop/src-common/advent/screens/scene.clj +++ b/desktop/src-common/advent/screens/scene.clj @@ -67,6 +67,7 @@ (defn left-click [screen entities] (let [[x y] (utils/unproject screen)] + (println "clicked " x y) (let [interaction (first (filter #((:mouse-in? %) entities x y) (get-in entities [:room :interactions]))) interacting-entity (first (sort-by (comp - :baseline) (filter #(and (:mouse-in? %) @@ -577,7 +578,7 @@ :on-mouse-moved (fn [{:keys [input-x input-y viewport] :as screen} [entities]] - (if (utils/contains? (.getScreenX viewport) (.getScreenY viewport) + (if (utils/contains-point? (.getScreenX viewport) (.getScreenY viewport) (.getScreenWidth viewport) (.getScreenHeight viewport) input-x input-y) @@ -586,7 +587,7 @@ (assoc-in entities [:cursor :override] nil))) :on-touch-up (fn [{:keys [input-x input-y viewport] :as screen} [entities]] - (when (utils/contains? (.getScreenX viewport) (.getScreenY viewport) + (when (utils/contains-point? (.getScreenX viewport) (.getScreenY viewport) (.getScreenWidth viewport) (.getScreenHeight viewport) input-x input-y) (if (= (button-code :right) diff --git a/desktop/src-common/advent/utils.clj b/desktop/src-common/advent/utils.clj index 5e71b4f3..ffea40ba 100644 --- a/desktop/src-common/advent/utils.clj +++ b/desktop/src-common/advent/utils.clj @@ -165,6 +165,6 @@ y (.y pj)] [x y])) -(defn contains? [x1 y1 width height x y] +(defn contains-point? [x1 y1 width height x y] (and (< x1 x (+ x1 width)) (< y1 y (+ y1 height))))