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]) opacity (get-in entities [:opacity])
entities (-> entities entities (-> entities
(assoc-in [:overlay :opacity] opacity) (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) (assoc-in [:highlighted-text :opacity] opacity)
(update-in [:items] (fn [i] (update-in [:items] (fn [i]
(map #(assoc % :opacity opacity) i))))] (map #(assoc % :opacity opacity) i))))]

View File

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

View File

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