From 1d173d537521db459fb48fa7666e571f932072ce Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Wed, 8 Aug 2018 18:54:06 +0200 Subject: intro: Fade before switch to game. --- scenes/intro.scm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scenes/intro.scm b/scenes/intro.scm index 8758a50..5b80b36 100644 --- a/scenes/intro.scm +++ b/scenes/intro.scm @@ -94,8 +94,14 @@ The leaf begins to dry.")) (define-method (on-key-press (intro ) key mods repeat?) (when (eq? key 'return) - (switch-scene (root-node) - (game)))) + (let ((fade (child-ref (parent intro) 'fade-all))) + (script + (tween 60 0.0 1.0 + (lambda (alpha) + (set! (color fade) + (make-color 0 0 0 alpha)))) + (switch-scene (root-node) + (game)))))) (define (intro) (set-music-volume! 1.0) -- cgit v1.2.3