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. --- Makefile.am | 1 + assets/images/README | 4 ++++ scenes/death.scm | 2 ++ scenes/intro.scm | 24 +++++++++++++++++++++++- 4 files changed, 30 insertions(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index 5c8f7cb..fb4eddf 100644 --- a/Makefile.am +++ b/Makefile.am @@ -70,6 +70,7 @@ ASSETS = \ assets/images/lorenzo.png \ assets/images/Food Pack.png \ assets/images/reaper.png \ + assets/images/intro-bg.png \ assets/images/README \ assets/maps/inner.tsx \ assets/maps/cave.tsx \ diff --git a/assets/images/README b/assets/images/README index e745940..5847096 100644 --- a/assets/images/README +++ b/assets/images/README @@ -1,3 +1,7 @@ +* intro-bg.png + +Based on "Sky background" by Paulina Riva; licensed under CC-BY 3.0 + * lorenzo.png + src/lorenzo.xcf Author: Ricardo Wurmus License: CC-BY-SA 3.0 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