From a990bd0b24bac57a2051cba505b54238e5485149 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Sat, 29 Oct 2022 14:18:35 -0400 Subject: Add basic time progression and game state reset. --- apple-town-fair/splash.scm | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'apple-town-fair/splash.scm') 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 )) - (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 )) + (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 (make + #:name 'splash + #:major-mode (make )))) (take-controller-focus 0 region) (replace-scene region scene) - (replace-major-mode scene (make )) (set! (camera region) (make #:width %game-width -- cgit v1.2.3