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 []]