fixed music up.
This commit is contained in:
@@ -676,9 +676,10 @@
|
||||
|
||||
(defn transition-background [entities new-background [x y] & {:keys [transition-music? between time face]}]
|
||||
(let [transition-music? (if (nil? transition-music?) true transition-music?)
|
||||
old-music (get-music (get-in @entities [:room :music]) (get-in @entities [:state :time]))
|
||||
old-music (get-music (get-in @entities [:room-musics (get-in @entities [:state :last-room])]) (get-in @entities [:state :time]))
|
||||
;; TODO FIX
|
||||
new-music old-music
|
||||
new-music (get-music (get-in @entities [:room-musics new-background]) (get-in @entities [:state :time]))
|
||||
_ (println old-music new-music)
|
||||
music-changed? (and transition-music? (not= old-music new-music))
|
||||
time (/ (float (or time 1.0)) 2.0)]
|
||||
(run-action entities
|
||||
@@ -720,7 +721,7 @@
|
||||
(begin [this screen entities]
|
||||
(utils/stop-all-sounds! entities)
|
||||
(let [ego (get-in entities [:room :entities :ego])
|
||||
old-music (get-music (get-in entities [:room :music]) (get-in entities [:state :time]))
|
||||
|
||||
entities (as-> entities e
|
||||
(assoc-in e [:room] ((get-in entities [:rooms new-background]) screen))
|
||||
(assoc-in e [:room :entities :ego] ego)
|
||||
@@ -740,7 +741,6 @@
|
||||
(if music-changed?
|
||||
(assoc-in e [:tweens :fade-in-music] (tween/tween :fade-in-music screen [:volume :value] 0.0 1.0 time))
|
||||
e))
|
||||
new-music (get-music (get-in entities [:room :music]) (get-in entities [:state :time]))
|
||||
apply-state (get-in entities [:room :apply-state])
|
||||
entities (if apply-state
|
||||
(apply-state screen entities)
|
||||
|
||||
Reference in New Issue
Block a user