From 87dd1ca4247d1014678dad72774bd068b1157f41 Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Mon, 29 Aug 2022 16:49:25 +0000 Subject: [PATCH] no more need to uncomment and recompile for debug rendering --- .../source/HabitState.kiss | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/projects/flixel-desktop-habit-puzzle-game/source/HabitState.kiss b/projects/flixel-desktop-habit-puzzle-game/source/HabitState.kiss index fa063c15..57cf08c6 100644 --- a/projects/flixel-desktop-habit-puzzle-game/source/HabitState.kiss +++ b/projects/flixel-desktop-habit-puzzle-game/source/HabitState.kiss @@ -59,14 +59,15 @@ (#when debug (debugLayer.clear) - (when (and model.rewardFiles rewardSprites.alive) + (when (and model.rewardFiles rewardSprites.alive FlxG.debugger.visible) (doFor s rewardSprites - null - // Uncomment for debugging piece rotation: - //(debugLayer.drawCircle s.x s.y 1 FlxColor.RED) - //(debugLayer.drawCircle (+ s.x s.origin.x) (+ s.y s.origin.y) 1 FlxColor.LIME) - // Uncomment for debugging match zones: - **(let [matchZones [(matchZoneLeft s) (matchZoneRight s)(matchZoneUp s)(matchZoneDown s)]] + + (let [i (dictGet indexMap s) + jig (dictGet pieceData i)] + (kiss_flixel.SpriteTools.writeOnSprite "$i" 32 s (object x (Percent 0.5) y (Percent 0.5)) FlxColor.RED) + (kiss_flixel.SpriteTools.writeOnSprite "(${jig.col},${jig.row})" 32 s (object x (Percent 0.5) y (Percent 0.7)) FlxColor.RED)) + + (let [matchZones [(matchZoneLeft s) (matchZoneRight s)(matchZoneUp s)(matchZoneDown s)]] (doFor z matchZones (unless z.isEmpty (debugLayer.drawFlxRect z FlxColor.RED))))))) @@ -482,11 +483,6 @@ ->:Void { (loadRotatedGraphic unhighlightedS) }) - - // Uncomment to debug piece IDs - **(#when debug - (kiss_flixel.SpriteTools.writeOnSprite "$i" 32 s (object x (Percent 0.5) y (Percent 0.5)) FlxColor.RED) - (kiss_flixel.SpriteTools.writeOnSprite "(${jig.col},${jig.row})" 32 s (object x (Percent 0.5) y (Percent 0.7)) FlxColor.RED)) (set s.cameras [pieceCamera])