Merge branch 'master' of github.com:ninjamuffin99/Funkin-secret into nitpix

This commit is contained in:
MtH 2021-03-17 19:15:18 +01:00
commit 87ec716ade
4 changed files with 111 additions and 0 deletions

View file

@ -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;

View file

@ -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);

View file

@ -113,6 +113,8 @@ class PlayState extends MusicBeatState
var bgGirls:BackgroundGirls;
var wiggleShit:WiggleEffect = new WiggleEffect();
var tankmanRun:FlxTypedGroup<TankmenBG>;
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<TankmenBG>();
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();

76
source/TankmenBG.hx Normal file
View file

@ -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();
}
}
}