From 183814559c74899c40218e0b8fb71e9d1540b272 Mon Sep 17 00:00:00 2001 From: SouthFox Date: Mon, 27 May 2024 07:46:43 +0800 Subject: [PATCH] [feat] level-2 --- game.scm | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/game.scm b/game.scm index 68102f8..f63b4d3 100644 --- a/game.scm +++ b/game.scm @@ -95,9 +95,7 @@ (make-level-1)) ((= *current-level* 2) (make-level-2)) - ) - - ) + )) (define *level* (make-current-level)) @@ -216,12 +214,16 @@ ; Draw title (match (level-state *level*) - ('win + ((or 'win 'thanks) (set-text-align! context "center") (set-font! context "bold 24px monospace") - (fill-text context "Goal equal! Press Enter to continue" (/ game-width 2.0) (/ game-height 2.0))) - (_ #t)) - (request-animation-frame draw-callback))) + (if (= *current-level* 2) + (begin (fill-text context "That's it, Thanks for playing." (/ game-width 2.0) (/ game-height 2.0)) + (set-level-state! *level* 'thanks)) + (fill-text context "Goal equal! Press Enter to continue." (/ game-width 2.0) (/ game-height 2.0)) + )) + (_ #t))) + (request-animation-frame draw-callback)) (define draw-callback (procedure->external draw)) (set-element-width! canvas (exact game-width))