water sounds nice.
This commit is contained in:
BIN
desktop/resources/outside-jail/fountain-2.ogg
Normal file
BIN
desktop/resources/outside-jail/fountain-2.ogg
Normal file
Binary file not shown.
BIN
desktop/resources/outside-jail/fountain-2.wav
Normal file
BIN
desktop/resources/outside-jail/fountain-2.wav
Normal file
Binary file not shown.
@@ -607,13 +607,16 @@
|
|||||||
(>= (get-in entities [:fade :opacity]) 1.0))
|
(>= (get-in entities [:fade :opacity]) 1.0))
|
||||||
|
|
||||||
(terminate [this screen entities]
|
(terminate [this screen entities]
|
||||||
(stop screen (if-let [next-time (get-in entities [:state :next-time])]
|
(let [entities (stop screen (if-let [next-time (get-in entities [:state :next-time])]
|
||||||
(-> entities
|
(-> entities
|
||||||
(assoc-in [:state :time] next-time)
|
(assoc-in [:state :time] next-time)
|
||||||
(assoc-in [:state :next-time] nil))
|
(assoc-in [:state :next-time] nil))
|
||||||
entities)
|
entities)
|
||||||
:ego
|
:ego
|
||||||
:face face))
|
:face face)]
|
||||||
|
(if-let [stop-fn (get-in entities [:room :stop-fn])]
|
||||||
|
(stop-fn screen entities)
|
||||||
|
entities)))
|
||||||
(can-skip? [this screen entities]
|
(can-skip? [this screen entities]
|
||||||
false))
|
false))
|
||||||
(run-action entities
|
(run-action entities
|
||||||
|
|||||||
@@ -81,6 +81,9 @@
|
|||||||
(actions/walk-straight-to entities :ego [142 96])
|
(actions/walk-straight-to entities :ego [142 96])
|
||||||
(actions/talk entities :ego "This must be Frankie Rockfist's secret stash!")))
|
(actions/talk entities :ego "This must be Frankie Rockfist's secret stash!")))
|
||||||
|
|
||||||
|
(defn fountain-vol [entities]
|
||||||
|
(utils/proximity-volume entities [172 120] :scale 0.5))
|
||||||
|
|
||||||
(defn make [screen]
|
(defn make [screen]
|
||||||
(let [guard-sheet (texture! (texture "inside-cafeteria/ladder-guard.png") :split 37 87)
|
(let [guard-sheet (texture! (texture "inside-cafeteria/ladder-guard.png") :split 37 87)
|
||||||
guard-stand (animation 0.1 [(aget guard-sheet 0 0)])
|
guard-stand (animation 0.1 [(aget guard-sheet 0 0)])
|
||||||
@@ -192,6 +195,8 @@
|
|||||||
:y 140
|
:y 140
|
||||||
:baseline 114)
|
:baseline 114)
|
||||||
:axe (assoc (texture "outside-jail/axe.png") :x 213 :y 63 :baseline 176 :night-profile :sprite)}
|
:axe (assoc (texture "outside-jail/axe.png") :x 213 :y 63 :baseline 176 :night-profile :sprite)}
|
||||||
|
:fountain-sound {:sound (sound "outside-jail/fountain-2.ogg")
|
||||||
|
:id nil}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -224,11 +229,24 @@
|
|||||||
:collision "outside-jail/collision.png"
|
:collision "outside-jail/collision.png"
|
||||||
:scale-fn (utils/scaler-fn-with-baseline 40 0.001 1.3)
|
:scale-fn (utils/scaler-fn-with-baseline 40 0.001 1.3)
|
||||||
:start-pos [145 15]
|
:start-pos [145 15]
|
||||||
|
|
||||||
|
:update-fn (fn [_ entities]
|
||||||
|
(when-let [fountain-sound-id (get-in entities [:room :fountain-sound :id])]
|
||||||
|
(sound! (get-in entities [:room :fountain-sound :sound]) :set-volume fountain-sound-id (fountain-vol entities)))
|
||||||
|
entities)
|
||||||
|
|
||||||
|
:stop-fn (fn [_ entities]
|
||||||
|
(when-let [fountain-sound-id (get-in entities [:room :fountain-sound :id])]
|
||||||
|
(sound! (get-in entities [:room :fountain-sound :sound]) :stop fountain-sound-id))
|
||||||
|
entities)
|
||||||
|
|
||||||
:apply-state (fn [_ entities]
|
:apply-state (fn [_ entities]
|
||||||
|
|
||||||
(as-> entities entities
|
(as-> entities entities
|
||||||
(if (= :night (get-in entities [:state :time]))
|
(assoc-in entities [:room :fountain-sound :id] (sound! (get-in entities [:room :fountain-sound :sound]) :loop (fountain-vol entities)))
|
||||||
(make-night entities)
|
(if (= :night (get-in entities [:state :time]))
|
||||||
entities)
|
(make-night entities)
|
||||||
(if (get-in entities [:state :dropped-ball?])
|
entities)
|
||||||
(update-in entities [:room :entities :guard] #(actions/start-animation % :sleep))
|
(if (get-in entities [:state :dropped-ball?])
|
||||||
entities))))))
|
(update-in entities [:room :entities :guard] #(actions/start-animation % :sleep))
|
||||||
|
entities))))))
|
||||||
|
|||||||
@@ -654,17 +654,11 @@ void main()
|
|||||||
((set (keys anim-sound-frames)) anim))
|
((set (keys anim-sound-frames)) anim))
|
||||||
(when-let [[snd vol-scale] (get-in anim-sound-frames [anim current-frame-index])]
|
(when-let [[snd vol-scale] (get-in anim-sound-frames [anim current-frame-index])]
|
||||||
(let [vol (if (= target :ego)
|
(let [vol (if (= target :ego)
|
||||||
(* (/ (get-in entities [:room :entities :ego :scale-x]) 1.5) 0.75)
|
(-> (* (/ (get-in entities [:room :entities :ego :scale-x]) 1.5) 0.75)
|
||||||
(max 0.0
|
(* (or vol-scale 1.0))
|
||||||
(- 1.0 (/ (utils/dist x y
|
(utils/clamp-volume))
|
||||||
(get-in entities [:room :entities :ego :x])
|
(utils/proximity-volume entities [x y] :scale vol-scale))
|
||||||
(get-in entities [:room :entities :ego :y])
|
pan (/ (- (:x e) 160 ) 160)]
|
||||||
:y-sign 2.0
|
|
||||||
:x-sign (/ 1.0 (get-in entities [:room :entities :ego :scale-x])))
|
|
||||||
175.0))))
|
|
||||||
pan (/ (- (:x e) 160 ) 160)
|
|
||||||
vol (* vol vol-scale)
|
|
||||||
vol (max vol 0.005)]
|
|
||||||
(sound! (or (snd e)
|
(sound! (or (snd e)
|
||||||
(snd (:sounds entities))) :play (utils/current-sound-volume vol) 1.0 pan))))))
|
(snd (:sounds entities))) :play (utils/current-sound-volume vol) 1.0 pan))))))
|
||||||
|
|
||||||
|
|||||||
@@ -239,3 +239,17 @@
|
|||||||
|
|
||||||
(def default-night-merge {:r 0.08 :g 0.1 :b 0.36 :multiply-amount 1.0 :hue-amount 1.0})
|
(def default-night-merge {:r 0.08 :g 0.1 :b 0.36 :multiply-amount 1.0 :hue-amount 1.0})
|
||||||
(def default-night-merge-sprite {:r 0.08 :g 0.1 :b 0.36 :multiply-amount 0.3 :hue-amount 0.4})
|
(def default-night-merge-sprite {:r 0.08 :g 0.1 :b 0.36 :multiply-amount 0.3 :hue-amount 0.4})
|
||||||
|
|
||||||
|
(defn clamp-volume [vol]
|
||||||
|
(max vol 0.005))
|
||||||
|
|
||||||
|
(defn proximity-volume [entities [x y] & {:keys [scale]}]
|
||||||
|
(-> (max 0.0
|
||||||
|
(- 1.0 (/ (dist x y
|
||||||
|
(get-in entities [:room :entities :ego :x])
|
||||||
|
(get-in entities [:room :entities :ego :y])
|
||||||
|
:y-sign 2.0
|
||||||
|
:x-sign (/ 1.0 (get-in entities [:room :entities :ego :scale-x])))
|
||||||
|
175.0)))
|
||||||
|
(* (or scale 1.0))
|
||||||
|
(clamp-volume)))
|
||||||
|
|||||||
Reference in New Issue
Block a user