sounds.
This commit is contained in:
@@ -135,6 +135,7 @@
|
||||
fire-sheet (texture! (texture "ego/fire.png") :split 18 36)
|
||||
walk-right (animation 0.075 (for [i (range 8)]
|
||||
(texture (aget player-sheet 0 i))))
|
||||
|
||||
stand-anim (animation 0.1 (for [i (flatten [(repeat 6 [(repeat 10 0) (repeat 3 1) (repeat 20 0)]) 3 4 5 5 5 6 5 6 5 6 5 4 3 ])]
|
||||
(texture (aget stand-sheet 0 i))))
|
||||
reach-up (animation 0.1 (for [i [0 3 4 5]]
|
||||
@@ -247,6 +248,7 @@
|
||||
:scaled true
|
||||
:step-sound-1 (sound "ego/step-1.ogg")
|
||||
:step-sound-2 (sound "ego/step-2.ogg")
|
||||
:blink (sound "blink.ogg")
|
||||
:scale-x start-scale
|
||||
:scale-y start-scale
|
||||
:talk-color (color 0.6 1.0 1.0 1.0)
|
||||
@@ -298,7 +300,23 @@
|
||||
ego (assoc ego :anim-sound-frames {(get-in ego [:left :walk]) {2 [:step-sound-1 1.0]
|
||||
6 [:step-sound-2 0.8]}
|
||||
(get-in ego [:right :walk]) {2 [:step-sound-1 1.0]
|
||||
6 [:step-sound-2 0.8]}}
|
||||
6 [:step-sound-2 0.8]}
|
||||
|
||||
(get-in ego [:left :talk] ) {2 [:blink 0.2]}
|
||||
(get-in ego [:right :talk] ) {2 [:blink 0.2]}
|
||||
|
||||
(get-in ego [:left :stand]) {11 [:blink 0.20]
|
||||
44 [:blink 0.20]
|
||||
77 [:blink 0.20]
|
||||
110 [:blink 0.20]
|
||||
143 [:blink 0.20]
|
||||
176 [:blink 0.20]}
|
||||
(get-in ego [:right :stand]) {11 [:blink 0.20]
|
||||
44 [:blink 0.20]
|
||||
77 [:blink 0.20]
|
||||
110 [:blink 0.20]
|
||||
143 [:blink 0.20]
|
||||
176 [:blink 0.20]}}
|
||||
:anim-merges {(get-in ego [:right :shock]) {:origin-x 15}
|
||||
:default {:origin-x 9}})]
|
||||
(actions/start-animation screen
|
||||
@@ -374,6 +392,7 @@
|
||||
(when (and (not= previous-frame-index current-frame-index)
|
||||
((set (keys anim-sound-frames)) anim))
|
||||
(when-let [[snd vol-scale] (get-in anim-sound-frames [anim current-frame-index])]
|
||||
|
||||
(let [vol (if (= target :ego)
|
||||
(* (/ (get-in entities [:ego :scale-x]) 1.5) 0.75)
|
||||
(max 0.0
|
||||
@@ -508,7 +527,9 @@
|
||||
(set! (.. (:value (:cam entities)) position x) (:x (:cam entities) 160.0))
|
||||
(set! (.. (:value (:cam entities)) position y) (:y (:cam entities) 120.0))
|
||||
|
||||
(play-key-sounds (get-in entities [:room :entities]))
|
||||
(when (= (get-in entities [:fade :opacity])
|
||||
0.0)
|
||||
(play-key-sounds (get-in entities [:room :entities])))
|
||||
(doseq [m (vals (get-in entities [:musics]))]
|
||||
(when m
|
||||
(music! m :set-volume (get-in entities [:volume :value]))))
|
||||
|
||||
Reference in New Issue
Block a user