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

@@ -10,6 +10,10 @@
[play-clj.g2d :refer :all]))
(defn make-night [entities]
(-> entities
(assoc-in [:room :entities :guard] (get-in entities [:room :guard]))))
(defn make [screen]
(let [fountain (utils/make-anim "outside-jail/fountain.png" [42 50] 0.2 (range 3))
guard-sheet (texture! (texture "inside-cafeteria/ladder-guard.png") :split 37 87)
@@ -27,8 +31,10 @@
:cursor :down}
:door {:box [22 42 46 124]
:script (actions/get-script entities
(actions/walk-to entities :ego [50 46])
(actions/talk entities :warden "NO VISITORS!"))}
(if (= :night (get-in @entities [:state :time]))
(actions/talk entities :ego "I do NOT want to go back in there!")
(do (actions/walk-to entities :ego [50 46])
(actions/talk entities :warden "NO VISITORS!"))))}
:window {:box [62 175 80 212]
:script (actions/get-script entities
(actions/talk entities :ego "I wonder if anyone is prisoner up there?"))}
@@ -82,7 +88,7 @@
:apply-state (fn [entities]
(as-> entities entities
(if (= :night (get-in entities [:state :time]))
(assoc-in entities [:room :entities :guard] (get-in entities [:room :guard]))
(make-night entities)
entities)
(if (get-in entities [:state :dropped-ball?])
(update-in entities [:room :entities :guard] #(actions/start-animation % :sleep))