Start of making the sheep interactable.
This commit is contained in:
@@ -83,8 +83,7 @@
|
||||
|
||||
(done? [this screen entities]
|
||||
(let [{from-x :x from-y :y :keys [left right anim] :as target-entity} (entities target-id)]
|
||||
(println final-x final-y from-x from-y (dist final-x final-y from-x from-y))
|
||||
(doto (< (dist final-x final-y from-x from-y) 1) println)))
|
||||
(< (dist final-x final-y from-x from-y) 1)))
|
||||
|
||||
(terminate [this screen entities]
|
||||
(let [entities (stop screen entities target-id)]
|
||||
|
||||
@@ -210,6 +210,20 @@
|
||||
(actions/get-script
|
||||
(actions/walk-to entities :ego [290 66])
|
||||
(actions/talk entities :ego "Maybe I can pull it out."))
|
||||
nil)))
|
||||
(reify
|
||||
IMouseIn
|
||||
(mouse-in? [_ location]
|
||||
(apply (zone/box 38 160 71 181) location))
|
||||
IInteractable
|
||||
(interact [_ screen entities cursor _]
|
||||
(case cursor
|
||||
:look
|
||||
(actions/get-script
|
||||
(actions/talk entities :ego (str "Aww, it's a cute little sheep.")))
|
||||
:touch
|
||||
(actions/get-script
|
||||
(actions/talk entities :ego "I guess his wool is shedding."))
|
||||
nil)))]
|
||||
:scale-fn (scaler-fn-with-baseline 110 0.10 1.00)
|
||||
:layers [(assoc background :x 0 :y 0 :baseline 0)
|
||||
|
||||
Reference in New Issue
Block a user