From 5ccbb5ef5b40689e58cd713b140eae2f8d125a47 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Sun, 4 Jun 2023 12:45:10 -0400 Subject: Add instructions the first time. --- super-bloom/game.scm | 75 ++++++++++++++++++++++++++++++++++------------------ 1 file changed, 49 insertions(+), 26 deletions(-) (limited to 'super-bloom') diff --git a/super-bloom/game.scm b/super-bloom/game.scm index db5b25c..311319c 100644 --- a/super-bloom/game.scm +++ b/super-bloom/game.scm @@ -58,6 +58,8 @@ (make-quadtree (make-rect 0.0 0.0 %game-width %game-height))) (define-class () + (show-instructions? #:accessor show-instructions? #:init-value #t + #:init-keyword #:show-instructions?) (quadtree #:getter quadtree #:init-thunk make-game-quadtree)) (define-method (on-enter (mode )) @@ -120,7 +122,9 @@ #:quadtree (quadtree mode) #:growth-goal 20 #:growth-interval 3.0)) - (start-game mode))) + (run-script mode + (show-instructions mode) + (start-game mode)))) (define-method (spawn-water (mode ) position) (attach-to (parent mode) @@ -205,21 +209,45 @@ (let ((wave (vector-ref waves (random (vector-length waves))))) (wave mode))) +(define-method (show-instructions (mode )) + (when (show-instructions? mode) + (set! (show-instructions? mode) #f) + (let ((scene (parent mode)) + (label (make