removing stuff that needs to go away at night.

This commit is contained in:
2014-12-27 23:26:10 -08:00
parent e6055f6941
commit bc55fa4c28
5 changed files with 84 additions and 37 deletions

View File

@@ -111,6 +111,10 @@
{:run #(do
(actions/respond entities % :wizard "Now scram!")
(actions/transition-background entities :outside-house [262 88]))}]}))
(defn make-night [entities]
(update-in entities [:room :entities] #(dissoc % :butterfly)))
(defn make [screen]
(let [sheep-stand-sheet (texture! (texture "outsidehouse/sheep-anim.png") :split 33 21)
sheep-walk-sheet (texture! (texture "outsidehouse/sheep-walk.png") :split 33 21)
@@ -129,11 +133,13 @@
(actions/talk entities :ego (str "Anyone home?"))
(sound! (sound "door.ogg") :play)
(actions/play-animation entities :ego :reach)
(actions/transition-background entities :inside-house [237 0])
(if (get-in @entities [:state :convinced-wizard?])
(do (actions/talk entities :wizard (str "Oh, hello there boy."))
(utils/save @entities))
(wizard-dialogue entities)))
(if (= :night (get-in @entities [:state :time]))
(actions/talk entities :ego "It's locked.")
(do (actions/transition-background entities :inside-house [237 0])
(if (get-in @entities [:state :convinced-wizard?])
(do (actions/talk entities :wizard (str "Oh, hello there boy."))
(utils/save @entities))
(wizard-dialogue entities)))))
:cursor :right}
:right-dir {:box [220 141 320 224]
@@ -237,5 +243,8 @@
(as-> entities entities
(if (get-in entities [:state :coaxed-sheep?])
(update-in entities [:room :entities :sheep] #(assoc % :x 95 :y 150 :baseline 40))
entities)
(if (= :night (get-in entities [:state :time]))
(make-night entities)
entities)))
:start-pos [30 80])))