rooms are beginning to be affected by state.

This commit is contained in:
2014-11-20 17:10:02 -08:00
parent 8e8713e278
commit 8e54c82979
3 changed files with 19 additions and 3 deletions

View File

@@ -68,4 +68,12 @@
(actions/update-entity entities :peeling #(assoc % :opacity 0))
(actions/update-state entities (fn [state] (assoc state :opened-crack? true)))))))}
:collision "behindhouse/collision.png"
:scale-fn (utils/scaler-fn-with-baseline 110 0.10 1.00)))
:scale-fn (utils/scaler-fn-with-baseline 110 0.10 1.00)
:apply-state (fn [entities]
(as-> entities entities
(if (get-in entities [:state :opened-crack?])
(assoc-in entities [:room :entities :peeling :opacity] 0)
entities)
(if (actions/has-one-of? entities [items/stick items/cat-toy])
(update-in entities [:room :entities] #(dissoc % :stick))
entities)))))

View File

@@ -226,7 +226,7 @@
:inside-fangald (make-music "inside-fangald.ogg")}
:state {:object nil
:active? true
:inventory [items/grass ]
:inventory [items/grass]
:clues #{}
:mints-eaten 0}
:actions {:object nil