more code cleanup because start-showing isn't needed.

This commit is contained in:
2015-04-29 18:17:01 -07:00
parent 1c7884840d
commit d6ac6a6628
3 changed files with 6 additions and 14 deletions

View File

@@ -54,27 +54,20 @@
(assoc inputed-key
:x (+ start-x 10 (* i 12))
:y (+ start-y 56))))
:start-showing? false
:shown? false}))
:on-render
(fn [screen [entities]]
(let [entities (if (:start-showing? entities)
(-> entities
(assoc :start-showing? false)
(assoc :shown? true))
entities)]
(when (:shown? entities)
(render! screen [(:fade entities) (:safe entities)])
(render! screen (take (count (:button-choices entities)) (:entered-keys entities))))
entities))
(when (:shown? entities)
(render! screen [(:fade entities) (:safe entities)])
(render! screen (take (count (:button-choices entities)) (:entered-keys entities))))
entities)
:show-screen (fn [{:keys [success failure]} [entities]]
(sound! (sound "inside-house/open-safe.ogg") :play (utils/current-sound-volume))
(assoc entities
:start-showing? true
:shown? true
:button-choices []
:success success
:failure failure))