diff options
Diffstat (limited to 'apple-town-fair/splash.scm')
-rw-r--r-- | apple-town-fair/splash.scm | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/apple-town-fair/splash.scm b/apple-town-fair/splash.scm index 8a1b0e3..9fcbd5b 100644 --- a/apple-town-fair/splash.scm +++ b/apple-town-fair/splash.scm @@ -17,6 +17,7 @@ #:use-module (apple-town-fair assets) #:use-module (apple-town-fair config) #:use-module (apple-town-fair common) + #:use-module (apple-town-fair game) #:use-module (chickadee graphics color) #:use-module (chickadee graphics path) #:use-module (chickadee math vector) @@ -69,23 +70,26 @@ #:text "https://dthompson.us/projects/chickadee.html")) (run-script scene (unless (getenv "SKIP_SPLASH") - (fade-in scene 1.0) - (sleep 1.0) - (fade-out scene 1.0)) - (let ((new-scene (make <scene>)) - (region (car (all-regions)))) - ;;(replace-scene region (make-game-scene)) - #t)))) + (let ((duration 0.25)) + (fade-in scene duration) + (sleep duration) + (fade-out scene duration))) + (switch-to-game-scene mode)))) + +(define-method (switch-to-game-scene (mode <splash-mode>)) + (replace-scene (car (all-regions)) + (make-game-scene))) (define (launch-game) (set! *random-state* (random-state-from-platform)) (run-catbird (lambda () (let ((region (create-full-region)) - (scene (make <scene>))) + (scene (make <scene> + #:name 'splash + #:major-mode (make <splash-mode>)))) (take-controller-focus 0 region) (replace-scene region scene) - (replace-major-mode scene (make <splash-mode>)) (set! (camera region) (make <camera-2d> #:width %game-width |