From 16a2cde7f162b1d6f63fd32b1301befa92b4b848 Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Tue, 6 Jun 2023 12:56:58 -0600 Subject: [PATCH] when defining position, remember old z --- src/hollywoo_flixel/FlxDirector.kiss | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/hollywoo_flixel/FlxDirector.kiss b/src/hollywoo_flixel/FlxDirector.kiss index 8627018..e1f8a8c 100644 --- a/src/hollywoo_flixel/FlxDirector.kiss +++ b/src/hollywoo_flixel/FlxDirector.kiss @@ -196,12 +196,13 @@ (method :Void defineStagePosition [:FlxCamera camera :StagePosition->Void submit &opt :StagePosition oldPos] (let [db (new DebugLayer)] (set db.cameras [camera]) - (db.drawCircle oldPos.x oldPos.y 4 FlxColor.YELLOW 2) + (when oldPos + (db.drawCircle oldPos.x oldPos.y 4 FlxColor.YELLOW 2)) (FlxG.state.add db) - (defineFlxPoint - ->point - {(FlxG.state.remove db) - (submit (new StagePosition point.x point.y 5.0))}))) + (defineFlxPoint + ->point + {(FlxG.state.remove db) + (submit (new StagePosition point.x point.y (or oldPos?.z 5.0)))}))) (method :Void defineLightSource [:FlxLightSource->Void submit] (let [points []]