fixed sound problems.
This commit is contained in:
@@ -589,7 +589,7 @@
|
|||||||
music
|
music
|
||||||
(time music)))
|
(time music)))
|
||||||
|
|
||||||
(defn transition-music [entities new-music & {:keys [duration]}]
|
(defn transition-music [entities new-music & {:keys [duration between]}]
|
||||||
(let [current-volume (atom 1.0)
|
(let [current-volume (atom 1.0)
|
||||||
duration (or duration 2.0)]
|
duration (or duration 2.0)]
|
||||||
(run-action entities
|
(run-action entities
|
||||||
@@ -608,8 +608,9 @@
|
|||||||
:when m]
|
:when m]
|
||||||
(music! m :stop))
|
(music! m :stop))
|
||||||
(let [entities (-> entities
|
(let [entities (-> entities
|
||||||
(assoc-in [:music-override :value] new-music)
|
((or between identity))
|
||||||
(assoc-in [:volume :value] 1.0))]
|
(assoc-in [:music-override :value] new-music)
|
||||||
|
(assoc-in [:volume :value] 1.0))]
|
||||||
(music! (utils/get-current-music entities) :set-volume (utils/current-music-volume))
|
(music! (utils/get-current-music entities) :set-volume (utils/current-music-volume))
|
||||||
(music! (utils/get-current-music entities) :play)
|
(music! (utils/get-current-music entities) :play)
|
||||||
entities))
|
entities))
|
||||||
|
|||||||
@@ -249,13 +249,18 @@
|
|||||||
(actions/transition-music entities nil :duration 0.15))
|
(actions/transition-music entities nil :duration 0.15))
|
||||||
|
|
||||||
(defn pull-sword [entities]
|
(defn pull-sword [entities]
|
||||||
(actions/play-animation entities :ego :reach)
|
(actions/play-animation entities :ego :reach-start :stop? false)
|
||||||
|
|
||||||
(actions/pause-camera entities)
|
(actions/pause-camera entities)
|
||||||
(actions/transition-music entities :pull-sword)
|
(actions/transition-music entities :pull-sword
|
||||||
(actions/add-entity entities :blackout (get-in @entities [:room :blackout]))
|
:between (fn [e]
|
||||||
(actions/add-entity entities :pull-sword (get-in @entities [:room :pull-sword]))
|
(as-> e e
|
||||||
|
(assoc-in e [:room :entities :blackout]
|
||||||
|
(get-in e [:room :blackout]))
|
||||||
|
(assoc-in e [:room :entities :pull-sword]
|
||||||
|
(get-in e [:room :pull-sword])))))
|
||||||
|
|
||||||
(actions/play-animation entities :pull-sword :pull-sword)
|
(actions/play-animation entities :pull-sword :pull-sword)
|
||||||
|
(actions/play-animation entities :ego :reach-stop)
|
||||||
(actions/give entities :sword)
|
(actions/give entities :sword)
|
||||||
(actions/remove-entity entities :sword)
|
(actions/remove-entity entities :sword)
|
||||||
(actions/remove-entity entities :pull-sword)
|
(actions/remove-entity entities :pull-sword)
|
||||||
@@ -442,9 +447,9 @@
|
|||||||
(assoc (utils/get-texture "inside-castle/way-back-tree.png") :x 0 :y 0 :baseline 97)
|
(assoc (utils/get-texture "inside-castle/way-back-tree.png") :x 0 :y 0 :baseline 97)
|
||||||
(assoc (utils/get-texture "inside-castle/roof.png") :x (- 320 57) :y 0 :baseline 240 :parallax 1.5)]}
|
(assoc (utils/get-texture "inside-castle/roof.png") :x (- 320 57) :y 0 :baseline 240 :parallax 1.5)]}
|
||||||
:blackout (assoc (utils/get-texture "black.png")
|
:blackout (assoc (utils/get-texture "black.png")
|
||||||
:x 0 :y 0
|
:x -10 :y -10
|
||||||
:width 320
|
:width 340
|
||||||
:height 240 :opacity 0.8
|
:height 260 :opacity 0.8
|
||||||
:baseline 239)
|
:baseline 239)
|
||||||
:pull-sword (assoc (animation->texture screen pull-sword-anim)
|
:pull-sword (assoc (animation->texture screen pull-sword-anim)
|
||||||
:x 10
|
:x 10
|
||||||
|
|||||||
@@ -418,7 +418,8 @@
|
|||||||
|
|
||||||
(defn scale-vol-from-fade [entities vol]
|
(defn scale-vol-from-fade [entities vol]
|
||||||
(* vol
|
(* vol
|
||||||
(- 1.0 (get-in entities [:fade :opacity]))))
|
(- 1.0 (get-in entities [:fade :opacity]))
|
||||||
|
(get-in entities [:volume :value])))
|
||||||
|
|
||||||
(defn play-sound!
|
(defn play-sound!
|
||||||
([screen entities snd volume-fn]
|
([screen entities snd volume-fn]
|
||||||
|
|||||||
Reference in New Issue
Block a user