From 1cde68cc912c866d10d108aeba88ec1bcac8f0da Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Wed, 31 Mar 2021 12:41:45 -0700 Subject: [PATCH] smoke effects on tankstage --- source/BGSprite.hx | 4 ++-- source/PlayState.hx | 12 ++++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/source/BGSprite.hx b/source/BGSprite.hx index a1013b015..89bcb7f0c 100644 --- a/source/BGSprite.hx +++ b/source/BGSprite.hx @@ -9,7 +9,7 @@ class BGSprite extends FlxSprite */ public var idleAnim:String; - public function new(image:String, x:Float = 0, y:Float = 0, parX:Float = 1, parY:Float = 1, ?daAnimations:Array) + public function new(image:String, x:Float = 0, y:Float = 0, parX:Float = 1, parY:Float = 1, ?daAnimations:Array, ?loopingAnim:Bool = false) { super(x, y); @@ -18,7 +18,7 @@ class BGSprite extends FlxSprite frames = Paths.getSparrowAtlas(image); for (anims in daAnimations) { - animation.addByPrefix(anims, anims, 24, false); + animation.addByPrefix(anims, anims, 24, loopingAnim); animation.play(anims); if (idleAnim == null) diff --git a/source/PlayState.hx b/source/PlayState.hx index 87b3a3cfe..8c6b0c645 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -497,7 +497,7 @@ class PlayState extends MusicBeatState defaultCamZoom = 0.90; curStage = 'tank'; - var bg:BGSprite = new BGSprite('tankSky', 0, -200, 0, 0); + var bg:BGSprite = new BGSprite('tankSky', -400, -400, 0, 0); add(bg); var tankSky:BGSprite = new BGSprite('tankClouds', 0, 10, 0.1, 0.1); @@ -512,6 +512,12 @@ class PlayState extends MusicBeatState var tankRuins:BGSprite = new BGSprite('tankRuins', -200, 170, 0.35, 0.35); add(tankRuins); + var smokeLeft:BGSprite = new BGSprite('smokeLeft', -200, -100, 0.4, 0.4, ['SmokeBlurLeft'], true); + add(smokeLeft); + + var smokeRight:BGSprite = new BGSprite('smokeRight', 1100, -100, 0.4, 0.4, ['SmokeRight'], true); + add(smokeRight); + var tankWatchtower:BGSprite = new BGSprite('tankWatchtower', 300, 50, 0.5, 0.5); add(tankWatchtower); @@ -521,6 +527,8 @@ class PlayState extends MusicBeatState tankmanRun = new FlxTypedGroup(); add(tankmanRun); + // smokeLeft.screenCenter(); + var fgTank0:BGSprite = new BGSprite('tank0', -290, 400, 1.7, 1.5, ['fg']); foregroundSprites.add(fgTank0); @@ -1660,7 +1668,7 @@ class PlayState extends MusicBeatState daNote.y += daNote.height / daNote.scale.y; if ((!daNote.mustPress || (daNote.wasGoodHit || (daNote.prevNote.wasGoodHit && !daNote.canBeHit))) - && daNote.y - daNote.offset.y * daNote.scale.y + daNote.height >= strumLineMid) + && daNote.y - daNote.offset.y * daNote.scale.y + daNote.height >= strumLineMid) { // div by scale because cliprect is affected by scale i THINK var swagRect:FlxRect = new FlxRect(0, 0, daNote.width / daNote.scale.x, daNote.height / daNote.scale.y);