From 42da0170d41df8652d74f5552d280bbc7813ffb1 Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Sun, 19 Feb 2023 08:35:07 -0700 Subject: [PATCH] habit puzzles hint how many matches. Close #120 --- .../source/HabitState.kiss | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/projects/flixel-desktop-habit-puzzle-game/source/HabitState.kiss b/projects/flixel-desktop-habit-puzzle-game/source/HabitState.kiss index aa4236cc..d25f5c35 100644 --- a/projects/flixel-desktop-habit-puzzle-game/source/HabitState.kiss +++ b/projects/flixel-desktop-habit-puzzle-game/source/HabitState.kiss @@ -7,6 +7,7 @@ (defAlias &ident textSize SimpleWindow.textSize) (prop &mut :FlxPomTimer pomTimer null) +(prop &mut :FlxText availableMatchesText (new FlxText 0 0 0 "" SimpleWindow.textSize)) (method &override :Void create [] (set FlxG.sound.soundTrayEnabled false) @@ -30,6 +31,9 @@ (set uiCamera (new FlxCamera)) (set SimpleWindow.defaultCamera uiCamera) (set uiCamera.bgColor FlxColor.TRANSPARENT) + (set availableMatchesText.color FlxColor.LIME) + (set availableMatchesText.cameras [uiCamera]) + (add availableMatchesText) (FlxG.cameras.add uiCamera) (FlxG.plugins.add (new FlxMouseControl)) (set FlxMouseControl.sortIndex "priorityID") @@ -59,6 +63,10 @@ (whileLet [f (nextFrameFunctions.shift)] (f))) + (set availableMatchesText.text "$(countAvailableMatches) matches can be made.") + (set availableMatchesText.y (- FlxG.height availableMatchesText.height)) + (set availableMatchesText.x (- FlxG.width availableMatchesText.width)) + // workaround for text box somehow losing focus: (when entryNameText (set entryNameText.hasFocus true)) (super.update elapsed)