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

@@ -51,7 +51,7 @@
opacity (get-in entities [:opacity])
entities (-> entities
(assoc-in [:overlay :opacity] opacity)
(assoc-in [:fade :opacity] (* 0.3 opacity))
(assoc-in [:fade :opacity] (* 0.6 opacity))
(assoc-in [:highlighted-text :opacity] opacity)
(update-in [:items] (fn [i]
(map #(assoc % :opacity opacity) i))))]

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))

View File

@@ -68,7 +68,6 @@
:font font
:music music
:volume 1.0
:start-showing? false
:start-playing start-playing
:quit quit
:tweens {:fade-in (tween/tween :fade-in screen [:fade :opacity] 1.0 0.0 1.0