smoke effects on tankstage

This commit is contained in:
Cameron Taylor 2021-03-31 12:41:45 -07:00
parent 5e74a0ea44
commit 1cde68cc91
2 changed files with 12 additions and 4 deletions

View file

@ -9,7 +9,7 @@ class BGSprite extends FlxSprite
*/ */
public var idleAnim:String; public var idleAnim:String;
public function new(image:String, x:Float = 0, y:Float = 0, parX:Float = 1, parY:Float = 1, ?daAnimations:Array<String>) public function new(image:String, x:Float = 0, y:Float = 0, parX:Float = 1, parY:Float = 1, ?daAnimations:Array<String>, ?loopingAnim:Bool = false)
{ {
super(x, y); super(x, y);
@ -18,7 +18,7 @@ class BGSprite extends FlxSprite
frames = Paths.getSparrowAtlas(image); frames = Paths.getSparrowAtlas(image);
for (anims in daAnimations) for (anims in daAnimations)
{ {
animation.addByPrefix(anims, anims, 24, false); animation.addByPrefix(anims, anims, 24, loopingAnim);
animation.play(anims); animation.play(anims);
if (idleAnim == null) if (idleAnim == null)

View file

@ -497,7 +497,7 @@ class PlayState extends MusicBeatState
defaultCamZoom = 0.90; defaultCamZoom = 0.90;
curStage = 'tank'; curStage = 'tank';
var bg:BGSprite = new BGSprite('tankSky', 0, -200, 0, 0); var bg:BGSprite = new BGSprite('tankSky', -400, -400, 0, 0);
add(bg); add(bg);
var tankSky:BGSprite = new BGSprite('tankClouds', 0, 10, 0.1, 0.1); 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); var tankRuins:BGSprite = new BGSprite('tankRuins', -200, 170, 0.35, 0.35);
add(tankRuins); 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); var tankWatchtower:BGSprite = new BGSprite('tankWatchtower', 300, 50, 0.5, 0.5);
add(tankWatchtower); add(tankWatchtower);
@ -521,6 +527,8 @@ class PlayState extends MusicBeatState
tankmanRun = new FlxTypedGroup<TankmenBG>(); tankmanRun = new FlxTypedGroup<TankmenBG>();
add(tankmanRun); add(tankmanRun);
// smokeLeft.screenCenter();
var fgTank0:BGSprite = new BGSprite('tank0', -290, 400, 1.7, 1.5, ['fg']); var fgTank0:BGSprite = new BGSprite('tank0', -290, 400, 1.7, 1.5, ['fg']);
foregroundSprites.add(fgTank0); foregroundSprites.add(fgTank0);
@ -1660,7 +1668,7 @@ class PlayState extends MusicBeatState
daNote.y += daNote.height / daNote.scale.y; daNote.y += daNote.height / daNote.scale.y;
if ((!daNote.mustPress || (daNote.wasGoodHit || (daNote.prevNote.wasGoodHit && !daNote.canBeHit))) 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 // 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); var swagRect:FlxRect = new FlxRect(0, 0, daNote.width / daNote.scale.x, daNote.height / daNote.scale.y);