diff options
author | Ricardo Wurmus <rekado@elephly.net> | 2018-07-27 23:16:12 +0200 |
---|---|---|
committer | Ricardo Wurmus <rekado@elephly.net> | 2018-07-27 23:16:12 +0200 |
commit | c74005d712fa022adfeb91681b2f75778e97e5a7 (patch) | |
tree | 0bca070d163a20bba30f385669494c4de494bce1 | |
parent | 22707789ec7b9ed6a9b9d821ea870354e2ff22d0 (diff) |
Add intro background.
-rw-r--r-- | Makefile.am | 1 | ||||
-rw-r--r-- | assets/images/README | 4 | ||||
-rw-r--r-- | scenes/death.scm | 2 | ||||
-rw-r--r-- | scenes/intro.scm | 24 |
4 files changed, 30 insertions, 1 deletions
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 <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)) |