added pit/broom/shovel.

This commit is contained in:
2015-04-09 18:20:09 -07:00
parent f3fad9b149
commit 9726d95a06

View File

@@ -197,7 +197,22 @@
(let [fairy-godfather-anim (utils/make-anim "dream/fairy-godfather.png" [63 77] 0.15 [0 1 2 3 2 1 0 1 4 3 2 1])
fairy-godfather-talk-anim (utils/make-anim "dream/fairy-godfather.png" [63 77] 0.15 [5 6 7 8 7 6])]
(rooms/make :music :town-1
:interactions {}
:interactions {:pit {:box [54 0 219 36]
:script (actions/get-script entities
(actions/walk-to entities :ego [154 41])
(actions/talk entities :ego "Wow! That's a long way down."))
:scripts {:shovel (actions/get-script entities
(actions/walk-to entities :ego [154 41])
(actions/talk entities :ego "I guess I'm doomed to be a grave-digger.")
(actions/play-animation entities :ego :sigh)
(actions/play-animation entities :ego :reach)
(actions/talk entities :ego "Wait a second! If I become a grave-digger, I'll never win Georgia McGorgeous' heart!"))
:broom (actions/get-script entities
(actions/walk-to entities :ego [154 41])
(actions/talk entities :ego "I guess I'm doomed to be a janitor.")
(actions/play-animation entities :ego :sigh)
(actions/play-animation entities :ego :reach)
(actions/talk entities :ego "Wait a second! If I become a janitor, I'll never win Georgia McGorgeous' heart!"))}}}
:layers [(assoc (texture "dream/clouds1.png") :x -10 :y 0 :baseline -1 :parallax 0.2 :scale-x 1.1 :scale-y 1.1)
(assoc (texture "dream/island.png") :x 180 :y 180 :baseline 0 :parallax 0.3 :scale-x 1.1 :scale-y 1.1)
(assoc (texture "dream/cliff.png") :x 50 :y 133 :baseline 1 :parallax 0.6 :scale-x 1.2 :scale-y 1.2)
@@ -289,7 +304,14 @@
:collision "dream/collision.png"
:scale-fn (utils/scaler-fn-from-image "dream/scale.png" 0.1 1.3)
:apply-state (fn [entities]
(if (get-in entities [:state :seen-intro?])
(set-opacity entities 1.0 1.0)
(set-opacity entities 0.0 0.0)))
(as-> entities entities
(if (get-in entities [:state :seen-intro?])
(set-opacity entities 1.0 1.0)
(set-opacity entities 0.0 0.0))
(if (actions/has-item? entities :broom)
(update-in entities [:room :entities] dissoc :broom)
entities)
(if (actions/has-item? entities :shovel)
(update-in entities [:room :entities] dissoc :shovel)
entities)))
:start-pos [140 55])))