From 8a557182da9aa2ad3e487da6107e2c1c783fd178 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Tue, 4 May 2021 17:14:34 -0400 Subject: Do not allow interaction during fades. Avoids some pretty gross bugs. --- test-subject/game.scm | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/test-subject/game.scm b/test-subject/game.scm index 5002823..c5aeeeb 100644 --- a/test-subject/game.scm +++ b/test-subject/game.scm @@ -725,15 +725,14 @@ what.")))) (define (tint-all color) ;; No-op if the user has done something to change state before the fade ;; in/out is done. - (when (eq? (state game) 'explore) - (set! (tint (& game explore-group room-background)) color) - (set! (tint (& game explore-group door-lock sprite)) color) - (set! (tint (& game explore-group door sprite)) color) - (set! (tint (& game explore-group control-panel sprite)) color) - (set! (tint (& game explore-group terminal sprite)) color) - (set! (tint (& game explore-group fridge sprite)) color) - (set! (tint (& game explore-group window sprite)) color) - (set! (tint (& game explore-group notebook sprite)) color))) + (set! (tint (& game explore-group room-background)) color) + (set! (tint (& game explore-group door-lock sprite)) color) + (set! (tint (& game explore-group door sprite)) color) + (set! (tint (& game explore-group control-panel sprite)) color) + (set! (tint (& game explore-group terminal sprite)) color) + (set! (tint (& game explore-group fridge sprite)) color) + (set! (tint (& game explore-group window sprite)) color) + (set! (tint (& game explore-group notebook sprite)) color)) (define (fade-in) (tween 120 black white tint-all #:interpolate color-lerp)) @@ -742,6 +741,7 @@ what.")))) #:interpolate color-lerp)) (define (end-game) (run-script game + (set! (state game) 'explore-wait) (fade-out) (detach-all game) (if (>= (friendship game) 3) @@ -871,7 +871,7 @@ if you would just open the door.") (lambda () (play-device-sound) (proc)))) - (set! (state game) 'explore) + (set! (state game) 'explore-wait) (attach-to game (make #:name 'explore-group @@ -930,7 +930,8 @@ if you would just open the door.") `((click . ,(run-on-left-click* game open-terminal))))))) (set! (background-music game) gameplay-music) (set! (background-music-loop? game) #t) - (fade-in)) + (fade-in) + (set! (state game) 'explore)) (define-method (roll-credits (game )) (set! (first-playthrough? game) #f) @@ -1040,7 +1041,7 @@ time?") ((dialog) (when (eq? button 'left) (channel-put! (click-channel game) #t))) - ((terminal) + ((terminal explore-wait) #f) (else (next-method)))) -- cgit v1.2.3