From b501d620b89716b45f857ff92a0d85ac627f0262 Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Sun, 18 Apr 2021 03:35:43 -0400 Subject: [PATCH] tank rolling lol XD --- source/PlayState.hx | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/source/PlayState.hx b/source/PlayState.hx index 8924cdb92..e1714e224 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -23,6 +23,7 @@ import flixel.graphics.atlas.FlxAtlas; import flixel.graphics.frames.FlxAtlasFrames; import flixel.group.FlxGroup.FlxTypedGroup; import flixel.group.FlxGroup; +import flixel.math.FlxAngle; import flixel.math.FlxMath; import flixel.math.FlxPoint; import flixel.math.FlxRect; @@ -133,6 +134,7 @@ class PlayState extends MusicBeatState var gfCutsceneLayer:FlxGroup; var bfTankCutsceneLayer:FlxGroup; var tankWatchtower:BGSprite; + var tankGround:BGSprite; var talking:Bool = true; var songScore:Int = 0; @@ -554,9 +556,14 @@ class PlayState extends MusicBeatState var smokeRight:BGSprite = new BGSprite('smokeRight', 1100, -100, 0.4, 0.4, ['SmokeRight'], true); add(smokeRight); + // tankGround. + tankWatchtower = new BGSprite('tankWatchtower', 100, 50, 0.5, 0.5, ['watchtower gradient color']); add(tankWatchtower); + tankGround = new BGSprite('tankRolling', 300, 300, 0.5, 0.5, ['BG tank w lighting'], true); + add(tankGround); + tankmanRun = new FlxTypedGroup(); add(tankmanRun); @@ -565,6 +572,8 @@ class PlayState extends MusicBeatState tankGround.updateHitbox(); add(tankGround); + moveTank(); + // smokeLeft.screenCenter(); var fgTank0:BGSprite = new BGSprite('tank0', -500, 650, 1.7, 1.5, ['fg']); @@ -1950,7 +1959,11 @@ class PlayState extends MusicBeatState } } - lightFadeShader.update((Conductor.crochet / 1000) * FlxG.elapsed * 1.5); // phillyCityLights.members[curLight].alpha -= (Conductor.crochet / 1000) * FlxG.elapsed; + lightFadeShader.update((Conductor.crochet / 1000) * FlxG.elapsed * 1.5); + // phillyCityLights.members[curLight].alpha -= (Conductor.crochet / 1000) * FlxG.elapsed; + + case 'tank': + moveTank(); } super.update(elapsed); @@ -2824,6 +2837,22 @@ class PlayState extends MusicBeatState }); } + function moveTank():Void + { + var daAngleOffset:Float = 1; + tankAngle += FlxG.elapsed * tankSpeed; + tankGround.angle = tankAngle - 90 + 15; + + tankGround.x = tankX + Math.cos(FlxAngle.asRadians((tankAngle * daAngleOffset) + 180)) * 1500; + tankGround.y = 1300 + Math.sin(FlxAngle.asRadians((tankAngle * daAngleOffset) + 180)) * 1100; + } + + var tankResetShit:Bool = false; + var tankMoving:Bool = false; + var tankAngle:Float = FlxG.random.int(-90, 45); + var tankSpeed:Float = FlxG.random.float(5, 7); + var tankX:Float = 400; + var trainMoving:Bool = false; var trainFrameTiming:Float = 0;