From eb8b9c481dece17754dd670f37b29d9a8fa3dfad Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Thu, 26 Jul 2018 19:37:35 +0200 Subject: Play error sound when talking is not possible. --- scenes/game.scm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'scenes') 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 @@ ;;; . (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 () (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 #:origin (vec2 (- (/ %width 2)) (- (/ %height 2)))))) + (set-music-volume! 1.0) + (set-sample-volume! 1.0) (with-agenda (agenda game) (schedule-every -- cgit v1.2.3