fixing interaction area.

This commit is contained in:
Bryce Covert
2015-11-18 17:53:38 -08:00
parent 36de48ac90
commit 2be32bf09e

View File

@@ -124,7 +124,9 @@
(defn make-night [entities] (defn make-night [entities]
(-> entities (-> entities
(update-in [:room :entities] #(dissoc % :grandma)) (update-in [:room :entities] #(dissoc % :grandma))
(utils/remove-interaction :ladder-area) (utils/remove-interaction :ladder-area-1)
(utils/remove-interaction :ladder-area-2)
(utils/remove-interaction :ladder-area-3)
(utils/remove-interaction :grandma) (utils/remove-interaction :grandma)
(update-in [:room :entities] #(assoc % :owl (get-in entities [:room :owl]))) (update-in [:room :entities] #(assoc % :owl (get-in entities [:room :owl])))
remove-rock-if-necessary)) remove-rock-if-necessary))
@@ -212,6 +214,17 @@
:owl "I'm sure you can find a use for it." :owl "I'm sure you can find a use for it."
:owl "And without pockets, I don't have much else I can give you." :owl "And without pockets, I don't have much else I can give you."
:ego "Thanks, I guess.")) :ego "Thanks, I guess."))
(defn make-ladder-area [box]
{:box box
:script (actions/get-script entities (actions/talk entities :ego "It's a really big tree!"))
:scripts {:ladder (actions/get-script entities
(actions/talk entities :ego "I'll just set this up.")
(actions/walk-to entities :ego [151 50] :face :left)
(actions/play-animation entities :ego :reach)
(actions/remove-item entities :ladder)
(actions/add-entity entities :ladder (get-in @entities [:room :ladder]))
(actions/walk-straight-to entities :ego [140 85] :face :right :update-baseline? false)
(actions/add-entity entities :blank (get-in @entities [:room :blank])))}})
(defn make [screen] (defn make [screen]
(let [cat-stand-sheet (texture! (utils/get-texture "cat-tree/cat-stand.png") :split 22 10) (let [cat-stand-sheet (texture! (utils/get-texture "cat-tree/cat-stand.png") :split 22 10)
@@ -253,15 +266,10 @@
(actions/transition-background entities :outside-house [137 204]) (actions/transition-background entities :outside-house [137 204])
(actions/walk-to entities :ego [158 110] :skip-type :end)) (actions/walk-to entities :ego [158 110] :skip-type :end))
:cursor :down} :cursor :down}
:ladder-area {:box [134 40 265 190] :ladder-area-1 (make-ladder-area [123 100 167 199])
:scripts {:ladder (actions/get-script entities :ladder-area-2 (make-ladder-area [87 151 227 212])
(actions/talk entities :ego "I'll just set this up.") :ladder-area-3 (make-ladder-area [133 69 205 92])
(actions/walk-to entities :ego [151 50] :face :left)
(actions/play-animation entities :ego :reach)
(actions/remove-item entities :ladder)
(actions/add-entity entities :ladder (get-in @entities [:room :ladder]))
(actions/walk-straight-to entities :ego [140 85] :face :right :update-baseline? false)
(actions/add-entity entities :blank (get-in @entities [:room :blank])))}}
:rock {:box [62 83 101 103] :rock {:box [62 83 101 103]
:script (actions/get-script entities :script (actions/get-script entities
(when (and (actions/has-obtained? entities :note-1) (when (and (actions/has-obtained? entities :note-1)