Start of making the sheep interactable.

This commit is contained in:
=
2014-09-15 20:26:31 -07:00
parent 124c0108be
commit 01c5c91f66
2 changed files with 15 additions and 2 deletions

View File

@@ -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)]

View File

@@ -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)