diff --git a/source/Character.hx b/source/Character.hx index 5c0c86639..86a630d49 100644 --- a/source/Character.hx +++ b/source/Character.hx @@ -82,6 +82,24 @@ class Character extends FlxSprite playAnim('danceRight'); + case 'bf-holding-gf': + frames = Paths.getSparrowAtlas('characters/bfAndGF'); + quickAnimAdd('idle', 'BF idle dance'); + quickAnimAdd('singDOWN', 'BF NOTE DOWN0'); + quickAnimAdd('singLEFT', 'BF NOTE LEFT0'); + quickAnimAdd('singRIGHT', 'BF NOTE RIGHT0'); + quickAnimAdd('singUP', 'BF NOTE UP0'); + + quickAnimAdd('singDOWNmiss', 'BF NOTE DOWN MISS'); + quickAnimAdd('singLEFTmiss', 'BF NOTE LEFT MISS'); + quickAnimAdd('singRIGHTmiss', 'BF NOTE RIGHT MISS'); + quickAnimAdd('singUPmiss', 'BF NOTE UP MISS'); + quickAnimAdd('bfCatch', 'BF catches GF'); + + loadOffsetFile(curCharacter); + + playAnim('idle'); + case 'gf-car': tex = Paths.getSparrowAtlas('gfCar'); frames = tex; diff --git a/source/HealthIcon.hx b/source/HealthIcon.hx index c821a84b3..9224904f1 100644 --- a/source/HealthIcon.hx +++ b/source/HealthIcon.hx @@ -16,6 +16,7 @@ class HealthIcon extends FlxSprite antialiasing = true; animation.add('bf', [0, 1], 0, false, isPlayer); + animation.add('bf-holding-gf', [0, 1], 0, false, isPlayer); animation.add('bf-car', [0, 1], 0, false, isPlayer); animation.add('bf-christmas', [0, 1], 0, false, isPlayer); animation.add('bf-pixel', [21, 21], 0, false, isPlayer); diff --git a/source/PlayState.hx b/source/PlayState.hx index 2a678c8de..e3918c8dc 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -113,6 +113,8 @@ class PlayState extends MusicBeatState var bgGirls:BackgroundGirls; var wiggleShit:WiggleEffect = new WiggleEffect(); + var tankmanRun:FlxTypedGroup; + var talking:Bool = true; var songScore:Int = 0; var scoreTxt:FlxText; @@ -499,6 +501,9 @@ class PlayState extends MusicBeatState var tankGround:BGSprite = new BGSprite('tankGround', -200, -20); add(tankGround); + tankmanRun = new FlxTypedGroup(); + add(tankmanRun); + var fgTank0:BGSprite = new BGSprite('tank0', -290, 400, 1.7, 1.5, ['fg']); foregroundSprites.add(fgTank0); @@ -2406,6 +2411,17 @@ class PlayState extends MusicBeatState } } + switch (curSong.toLowerCase()) + { + case 'stress': + if (FlxG.random.bool()) + { + var tank:TankmenBG = new TankmenBG(500, 200); + tank.strumTime = Conductor.songPosition + (Conductor.crochet * 4); + tankmanRun.add(tank); + } + } + if (isHalloween && FlxG.random.bool(10) && curBeat > lightningStrikeBeat + lightningOffset) { lightningStrikeShit(); diff --git a/source/TankmenBG.hx b/source/TankmenBG.hx new file mode 100644 index 000000000..bdd56e8a3 --- /dev/null +++ b/source/TankmenBG.hx @@ -0,0 +1,76 @@ +package; + +import flixel.FlxG; +import flixel.FlxSprite; +import haxe.display.Display.Package; + +class TankmenBG extends FlxSprite +{ + public var strumTime:Float = 0; + public var goingRight:Bool = false; + public var tankSpeed:Float = 0.7; + + public var endingOffset:Float; + + public function new(x:Float, y:Float) + { + super(x, y); + + // makeGraphic(200, 200); + + frames = Paths.getSparrowAtlas('tankmanKilled1'); + antialiasing = true; + animation.addByPrefix('run', 'tankman running', 24, true); + animation.addByPrefix('shot', 'John', 24, false); + + animation.play('run'); + + y += FlxG.random.int(-40, 100); + + goingRight = FlxG.random.bool(); + endingOffset = FlxG.random.float(0, 120); + + tankSpeed = FlxG.random.float(0.65, 0.8); + + if (goingRight) + flipX = true; + } + + override function update(elapsed:Float) + { + super.update(elapsed); + + if (animation.curAnim.name == 'run') + { + var endDirection:Float = (FlxG.width * 0.74) + endingOffset; + + if (goingRight) + { + endDirection = (FlxG.width * 0.02) - endingOffset; + + x = (endDirection + (Conductor.songPosition - strumTime) * tankSpeed); + } + else + { + x = (endDirection - (Conductor.songPosition - strumTime) * tankSpeed); + } + } + + if (Conductor.songPosition > strumTime) + { + // kill(); + animation.play('shot'); + + if (goingRight) + { + offset.y = 200; + offset.x = 300; + } + } + + if (animation.curAnim.name == 'shot' && animation.curAnim.curFrame >= animation.curAnim.frames.length - 1) + { + kill(); + } + } +}