diff options
Diffstat (limited to 'scenes/intro.scm')
-rw-r--r-- | scenes/intro.scm | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/scenes/intro.scm b/scenes/intro.scm index 422d2ec..68d5b79 100644 --- a/scenes/intro.scm +++ b/scenes/intro.scm @@ -67,15 +67,17 @@ The sunshine warms and blinds. The leaf begins to dry.")) (define welcome-text #false) +(define *background-music* #false) (define (load-scene) (set! *random-state* (random-state-from-platform)) (set! welcome-text (list-ref texts (random (length texts)))) - (source-play - (make-source #:audio - (asset-ref music) - #:loop? #false)) + + (set! *background-music* + (make-source #:audio (asset-ref music) + #:loop? #false)) + (source-play *background-music*) (with-agenda agenda @@ -131,7 +133,12 @@ The leaf begins to dry.")) (define scene - `(#:name "intro" - #:load ,load-scene - #:draw ,draw-scene - #:update ,update-scene)) + (list + #:name "intro" + #:load load-scene + #:draw draw-scene + #:update update-scene + #:quit + (lambda () + (and *background-music* + (source-stop *background-music*))))) |