From c74005d712fa022adfeb91681b2f75778e97e5a7 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Fri, 27 Jul 2018 23:16:12 +0200 Subject: Add intro background. --- scenes/death.scm | 2 ++ scenes/intro.scm | 24 +++++++++++++++++++++++- 2 files changed, 25 insertions(+), 1 deletion(-) (limited to 'scenes') 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 )) + (let ((container (make + #:children + (list + (make + #:name 'bg + #:texture (load-image "assets/images/intro-bg.png")) + (make ) + (make + #: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)) -- cgit v1.2.3