diff --git a/desktop/src-common/advent/actions.clj b/desktop/src-common/advent/actions.clj index 230046b3..5a216c9e 100644 --- a/desktop/src-common/advent/actions.clj +++ b/desktop/src-common/advent/actions.clj @@ -55,8 +55,8 @@ :anim-start (:total-time screen)) entity))) -(defn stop [screen entities target-id] - (update-in entities [:room :entities target-id] #(start-animation screen % :stand))) +(defn stop [screen entities target-id & {:keys [face]}] + (update-in entities [:room :entities target-id] (comp #(start-animation screen % :stand) (if face #(assoc % :facing face) identity)))) (defmacro run-action [entities & forms] @@ -139,7 +139,7 @@ (terminate [this screen entities] entities) (can-skip? [this screen entities] false))) -(defn walk-to [entities target-id [final-x final-y] & [can-skip?]] +(defn walk-to [entities target-id [final-x final-y] & {:keys [can-skip? face]}] (let [{start-x :x start-y :y} (get-in @entities [:room :entities target-id]) final-x (int final-x) final-y (int final-y) @@ -188,7 +188,7 @@ (< (utils/dist final-x final-y from-x from-y) 1))) (terminate [this screen entities] - (stop screen entities target-id)) + (stop screen entities target-id :face face)) (can-skip? [this screen entities] (or can-skip? false))) @entities))) diff --git a/desktop/src-common/advent/screens/inventory.clj b/desktop/src-common/advent/screens/inventory.clj index 67c35e73..bf3e852f 100644 --- a/desktop/src-common/advent/screens/inventory.clj +++ b/desktop/src-common/advent/screens/inventory.clj @@ -97,5 +97,4 @@ (close entities))))) :on-resize (fn [screen entities] - (height! screen 960) - entities)) + (size! screen 1280 960))) diff --git a/desktop/src-common/advent/screens/rooms/outside_house.clj b/desktop/src-common/advent/screens/rooms/outside_house.clj index 683ec941..102e2bfc 100644 --- a/desktop/src-common/advent/screens/rooms/outside_house.clj +++ b/desktop/src-common/advent/screens/rooms/outside_house.clj @@ -168,7 +168,7 @@ (if (actions/has-item? @entities items/wool) (actions/talk entities :ego "The sheep has given me enough wool.") (if (is-sheep-close? @entities) - (do (actions/walk-to entities :ego ego-sheep-loc) + (do (actions/walk-to entities :ego ego-sheep-loc :face :left) (actions/play-animation entities :ego :reach) (actions/give entities items/wool) (actions/talk entities :ego "I guess her wool is shedding.")) @@ -176,12 +176,12 @@ :scripts {:wool (actions/get-script entities (actions/talk entities :ego "She doesn't need it back.")) :carrot (actions/get-script entities - (actions/walk-to entities :ego ego-sheep-loc) + (actions/walk-to entities :ego ego-sheep-loc :face :left) (actions/talk entities :ego "Come on girl, get the carrot!") (actions/walk-straight-to entities :sheep [95 150])) :flask-1 (actions/get-script entities (if (is-sheep-close? @entities) - (do (actions/walk-to entities :ego ego-sheep-loc) + (do (actions/walk-to entities :ego ego-sheep-loc :face :left) (actions/play-animation entities :ego :reach) (actions/remove-item entities items/flask-1) (actions/give entities items/flask-1-with-milk) diff --git a/desktop/src-common/advent/screens/scene.clj b/desktop/src-common/advent/screens/scene.clj index 5e58b222..39b8f9d0 100644 --- a/desktop/src-common/advent/screens/scene.clj +++ b/desktop/src-common/advent/screens/scene.clj @@ -29,7 +29,7 @@ (def default-interaction {:get-script (fn [cursor [x y]] (if (= :main cursor) (actions/get-script entities - (actions/walk-to entities :ego [x y] true)) + (actions/walk-to entities :ego [x y] :can-skip? true)) (actions/get-script entities (actions/talk entities :ego "I don't know what to do with that."))))})