From 0d6ef4b20f4a98121a6feae3f290ce558c012d0f Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Mon, 5 Oct 2020 13:55:48 -0700 Subject: [PATCH] BACKGROUNDS --- source/PlayState.hx | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/source/PlayState.hx b/source/PlayState.hx index a09d82ac8..78509978b 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -71,26 +71,42 @@ class PlayState extends FlxTransitionableState persistentUpdate = true; persistentDraw = true; - var bg:FlxSprite = new FlxSprite(-600, -200).loadGraphic(AssetPaths.bg__png); - bg.setGraphicSize(Std.int(bg.width * 2.5)); - bg.updateHitbox(); + var bg:FlxSprite = new FlxSprite(-600, -200).loadGraphic(AssetPaths.stageback__png); + // bg.setGraphicSize(Std.int(bg.width * 2.5)); + // bg.updateHitbox(); bg.antialiasing = true; bg.scrollFactor.set(0.9, 0.9); bg.active = false; add(bg); + var stageFront:FlxSprite = new FlxSprite(-650, 600).loadGraphic(AssetPaths.stagefront__png); + stageFront.setGraphicSize(Std.int(stageFront.width * 1.1)); + stageFront.updateHitbox(); + stageFront.antialiasing = true; + stageFront.scrollFactor.set(0.9, 0.9); + stageFront.active = false; + add(stageFront); + + var stageCurtains:FlxSprite = new FlxSprite(-500, -300).loadGraphic(AssetPaths.stagecurtains__png); + stageCurtains.setGraphicSize(Std.int(stageCurtains.width * 0.9)); + stageCurtains.updateHitbox(); + stageCurtains.antialiasing = true; + stageCurtains.scrollFactor.set(1.3, 1.3); + stageCurtains.active = false; + gf = new Girlfriend(400, 130); gf.scrollFactor.set(0.95, 0.95); gf.antialiasing = true; add(gf); dad = new Dad(100, 100); - add(dad); boyfriend = new Boyfriend(770, 450); add(boyfriend); + add(stageCurtains); + strumLine = new FlxSprite(0, 50).makeGraphic(FlxG.width, 10); strumLine.scrollFactor.set(); @@ -373,7 +389,7 @@ class PlayState extends FlxTransitionableState { super.update(elapsed); - healthHeads.setGraphicSize(Std.int(FlxMath.lerp(healthHeads.width, 80, 0.02))); + healthHeads.setGraphicSize(Std.int(FlxMath.lerp(100, healthHeads.width, 0.98))); healthHeads.x = healthBar.x + (healthBar.width * (FlxMath.remapToRange(healthBar.percent, 0, 100, 100, 0) * 0.01)) - (healthHeads.width / 2); if (FlxG.keys.justPressed.NINE)