diff --git a/desktop/resources/blink-other.ogg b/desktop/resources/blink-other.ogg new file mode 100644 index 00000000..19fefd13 Binary files /dev/null and b/desktop/resources/blink-other.ogg differ diff --git a/desktop/resources/blink-other.wav b/desktop/resources/blink-other.wav new file mode 100644 index 00000000..39763736 Binary files /dev/null and b/desktop/resources/blink-other.wav differ diff --git a/desktop/resources/blink.ogg b/desktop/resources/blink.ogg new file mode 100644 index 00000000..aacb8869 Binary files /dev/null and b/desktop/resources/blink.ogg differ diff --git a/desktop/resources/blink.wav b/desktop/resources/blink.wav new file mode 100644 index 00000000..daf1f7e5 Binary files /dev/null and b/desktop/resources/blink.wav differ diff --git a/desktop/resources/outside-castle/scratch.ogg b/desktop/resources/outside-castle/scratch.ogg new file mode 100644 index 00000000..e0d356d1 Binary files /dev/null and b/desktop/resources/outside-castle/scratch.ogg differ diff --git a/desktop/resources/outside-castle/scratch.wav b/desktop/resources/outside-castle/scratch.wav new file mode 100644 index 00000000..6ce39095 Binary files /dev/null and b/desktop/resources/outside-castle/scratch.wav differ diff --git a/desktop/resources/outside-castle/scratch_1.wav b/desktop/resources/outside-castle/scratch_1.wav new file mode 100644 index 00000000..67403292 Binary files /dev/null and b/desktop/resources/outside-castle/scratch_1.wav differ diff --git a/desktop/src-common/advent/screens/rooms/inside_castle.clj b/desktop/src-common/advent/screens/rooms/inside_castle.clj index 4068628f..8f4542bc 100644 --- a/desktop/src-common/advent/screens/rooms/inside_castle.clj +++ b/desktop/src-common/advent/screens/rooms/inside_castle.clj @@ -323,6 +323,7 @@ :game-player (assoc (texture "inside-castle/gameplayer.png") :x 266 :y 49 :baseline 191 `:talk-color (color 1.0 0.3 0.2 1.0) :script (actions/get-script entities (do-game-player-dialogue entities)) + :blink (sound "blink-other.ogg") :scripts #(condp = % :wool (actions/get-script entities (walk-to-player entities) @@ -371,6 +372,7 @@ :anim game-player-stand :anim-start 0 :stand game-player-stand + :anim-sound-frames {game-player-stand {11 [:blink 0.3] }} :flex game-player-flex :talk game-player-talk)} :monocle (rooms/make-entity :monocle (assoc (animation->texture screen monocle) diff --git a/desktop/src-common/advent/screens/rooms/outside_castle.clj b/desktop/src-common/advent/screens/rooms/outside_castle.clj index 441cae45..09f57637 100644 --- a/desktop/src-common/advent/screens/rooms/outside_castle.clj +++ b/desktop/src-common/advent/screens/rooms/outside_castle.clj @@ -295,8 +295,9 @@ :sunrise [(assoc (texture "outside-castle/background-sunrise.png") :x 0 :y 0 :baseline 0)]} :entities {:peddler (actions/start-animation screen (assoc (texture "outside-castle/peddler.png") :x 110 :y 90 :baseline 150 :anim nil - :anim-sound-frames {peddler-stand {23 [:scratch 1.0]}} - :scratch (sound "scratch.ogg") + :anim-sound-frames {peddler-stand {23 [:scratch 1.0]} + peddler-talk {23 [:scratch 1.0]}} + :scratch (sound "outside-castle/scratch.ogg") :talk peddler-talk :stand peddler-stand :talk-color (color 1.0 0.9 0.4 1.0) :script (actions/get-script diff --git a/desktop/src-common/advent/screens/scene.clj b/desktop/src-common/advent/screens/scene.clj index e9f12244..44f34573 100644 --- a/desktop/src-common/advent/screens/scene.clj +++ b/desktop/src-common/advent/screens/scene.clj @@ -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]))))