summaryrefslogtreecommitdiff
path: root/scenes
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2018-07-27 23:16:12 +0200
committerRicardo Wurmus <rekado@elephly.net>2018-07-27 23:16:12 +0200
commitc74005d712fa022adfeb91681b2f75778e97e5a7 (patch)
tree0bca070d163a20bba30f385669494c4de494bce1 /scenes
parent22707789ec7b9ed6a9b9d821ea870354e2ff22d0 (diff)
Add intro background.
Diffstat (limited to 'scenes')
-rw-r--r--scenes/death.scm2
-rw-r--r--scenes/intro.scm24
2 files changed, 25 insertions, 1 deletions
diff --git a/scenes/death.scm b/scenes/death.scm
index 34a8af8..a2b6921 100644
--- a/scenes/death.scm
+++ b/scenes/death.scm
@@ -93,6 +93,8 @@ quite short."))
'(("The Inevitable Game"
"Made by Ricardo Wurmus"
"For Lorenzo")
+ ("Sky background"
+ "by Paulina Riva (CC-BY 3.0)")
("Reaper character graphics"
"based on \"Lil Reaper Pet\" by Tracy")
("Lorenzo character graphics"
diff --git a/scenes/intro.scm b/scenes/intro.scm
index cc6c5a0..4fb4b69 100644
--- a/scenes/intro.scm
+++ b/scenes/intro.scm
@@ -19,7 +19,10 @@
#:use-module (chickadee audio)
#:use-module (chickadee math rect)
#:use-module (chickadee math vector)
+ #:use-module (chickadee render color)
#:use-module (chickadee render font)
+ #:use-module (chickadee render texture)
+ #:use-module (chickadee scripting)
#:use-module (engine assets)
#:use-module (engine node)
#:use-module (engine node-2d)
@@ -93,4 +96,23 @@ to dry."))
(define (intro)
(set-music-volume! 1.0)
(play-music (load-music "assets/music/intro.ogg") #:loop? #f)
- (make <intro>))
+ (let ((container (make <node-2d>
+ #:children
+ (list
+ (make <sprite>
+ #:name 'bg
+ #:texture (load-image "assets/images/intro-bg.png"))
+ (make <intro>)
+ (make <filled-rect>
+ #:name 'fade-all
+ #:region (make-rect 0.0 0.0 %width %height)
+ #:color (make-color 1 1 1 1.0))))))
+ ;; Fade in
+ (with-agenda
+ (agenda container)
+ (script
+ (tween 240 1.0 0.0
+ (lambda (alpha)
+ (set! (color (child-ref container 'fade-all))
+ (make-color 1 1 1 alpha))))))
+ container))