summaryrefslogtreecommitdiff
path: root/scenes
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2018-08-08 18:54:06 +0200
committerRicardo Wurmus <rekado@elephly.net>2018-08-08 18:54:06 +0200
commit1d173d537521db459fb48fa7666e571f932072ce (patch)
treea9540d107c8fe586580c7065a399c39d0cc94c76 /scenes
parent9383dcc5e654f96421b73205911ad755c748a648 (diff)
intro: Fade before switch to game.
Diffstat (limited to 'scenes')
-rw-r--r--scenes/intro.scm10
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)