summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2018-07-26 19:37:35 +0200
committerRicardo Wurmus <rekado@elephly.net>2018-07-27 17:15:48 +0200
commiteb8b9c481dece17754dd670f37b29d9a8fa3dfad (patch)
treee1b4c5751149cc095385b6b64a455981b8ecd9ba
parent92a5dd6117d0653b20dfa2165c1d7eef7837652a (diff)
Play error sound when talking is not possible.
-rw-r--r--assets/sounds/README2
-rw-r--r--assets/sounds/error.oggbin0 -> 8495 bytes
-rw-r--r--scenes/game.scm6
3 files changed, 7 insertions, 1 deletions
diff --git a/assets/sounds/README b/assets/sounds/README
new file mode 100644
index 0000000..f3f2a09
--- /dev/null
+++ b/assets/sounds/README
@@ -0,0 +1,2 @@
+* error.ogg
+Taken from gnome-control-center's "drip.ogg"
diff --git a/assets/sounds/error.ogg b/assets/sounds/error.ogg
new file mode 100644
index 0000000..144d2b3
--- /dev/null
+++ b/assets/sounds/error.ogg
Binary files differ
diff --git a/scenes/game.scm b/scenes/game.scm
index 1e753cd..cb05f70 100644
--- a/scenes/game.scm
+++ b/scenes/game.scm
@@ -17,6 +17,7 @@
;;; <http://www.gnu.org/licenses/>.
(define-module (scenes game)
+ #:use-module (chickadee audio)
#:use-module (chickadee input keyboard)
#:use-module (chickadee math rect)
#:use-module (chickadee math vector)
@@ -52,6 +53,7 @@
(define-asset test-map (load-tile-map "assets/maps/01.tmx"))
+(define-asset error-sample (load-sample "assets/sounds/error.ogg"))
(define-class <game> (<scene>)
(status #:accessor status #:init-form 'playing)
@@ -324,7 +326,7 @@ conversation."
(if (null? (available-messages player))
;; nothing to say! Play error sound.
(begin
- (pk 'nothing-to-say)
+ (play-sample (asset-ref error-sample))
(stop-talking player))
;; Prepare empty text bubble
(let ((bubble (child-ref (parent (parent player)) 'text-bubble)))
@@ -407,6 +409,8 @@ conversation."
(let ((game (make <game>
#:origin (vec2 (- (/ %width 2))
(- (/ %height 2))))))
+ (set-music-volume! 1.0)
+ (set-sample-volume! 1.0)
(with-agenda
(agenda game)
(schedule-every