diff options
author | Ricardo Wurmus <rekado@elephly.net> | 2018-08-08 18:54:06 +0200 |
---|---|---|
committer | Ricardo Wurmus <rekado@elephly.net> | 2018-08-08 18:54:06 +0200 |
commit | 1d173d537521db459fb48fa7666e571f932072ce (patch) | |
tree | a9540d107c8fe586580c7065a399c39d0cc94c76 | |
parent | 9383dcc5e654f96421b73205911ad755c748a648 (diff) |
intro: Fade before switch to game.
-rw-r--r-- | scenes/intro.scm | 10 |
1 files 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 <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) |