1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2025-04-11 14:54:52 +00:00

tankmen foreground in progress

This commit is contained in:
Cameron Taylor 2021-03-08 18:38:58 -05:00
parent 4fae6773c9
commit d7aba46853
3 changed files with 85 additions and 11 deletions

View file

@ -7,13 +7,37 @@ class BGSprite extends FlxSprite
/** /**
Cool lil utility thing just so that it can easy do antialiasing and scrollfactor bullshit Cool lil utility thing just so that it can easy do antialiasing and scrollfactor bullshit
*/ */
public function new(image:String, x:Float = 0, y:Float = 0, parX:Float = 1, parY:Float = 1) public var idleAnim:String;
public function new(image:String, x:Float = 0, y:Float = 0, parX:Float = 1, parY:Float = 1, ?daAnimations:Array<String>)
{ {
super(x, y); super(x, y);
if (daAnimations != null)
{
frames = Paths.getSparrowAtlas(image);
for (anims in daAnimations)
{
animation.addByPrefix(anims, anims, 24, false);
animation.play(anims);
if (idleAnim == null)
idleAnim = anims;
}
}
else
{
loadGraphic(Paths.image(image)); loadGraphic(Paths.image(image));
scrollFactor.set(parX, parY);
antialiasing = true;
active = false; active = false;
} }
scrollFactor.set(parX, parY);
antialiasing = true;
}
public function dance():Void
{
if (idleAnim != null)
animation.play(idleAnim);
}
} }

View file

@ -17,7 +17,13 @@ class PauseSubState extends MusicBeatSubstate
{ {
var grpMenuShit:FlxTypedGroup<Alphabet>; var grpMenuShit:FlxTypedGroup<Alphabet>;
var pauseOG:Array<String> = ['Resume', 'Restart Song', 'Change Difficulty', 'Exit to menu']; var pauseOG:Array<String> = [
'Resume',
'Restart Song',
'Change Difficulty',
'Toggle Practice Mode',
'Exit to menu'
];
var difficultyChoices:Array<String> = ['EASY', 'NORMAL', 'HARD', 'BACK']; var difficultyChoices:Array<String> = ['EASY', 'NORMAL', 'HARD', 'BACK'];
var menuItems:Array<String> = []; var menuItems:Array<String> = [];
@ -25,6 +31,8 @@ class PauseSubState extends MusicBeatSubstate
var pauseMusic:FlxSound; var pauseMusic:FlxSound;
var practiceText:FlxText;
public function new(x:Float, y:Float) public function new(x:Float, y:Float)
{ {
super(); super();
@ -63,6 +71,14 @@ class PauseSubState extends MusicBeatSubstate
deathCounter.updateHitbox(); deathCounter.updateHitbox();
add(deathCounter); add(deathCounter);
practiceText = new FlxText(20, 15 + 64 + 32, 0, "PRACTICE MODE", 32);
practiceText.scrollFactor.set();
practiceText.setFormat(Paths.font('vcr.ttf'), 32);
practiceText.updateHitbox();
practiceText.x = FlxG.width - (practiceText.width + 20);
practiceText.visible = PlayState.practiceMode;
add(practiceText);
levelDifficulty.alpha = 0; levelDifficulty.alpha = 0;
levelInfo.alpha = 0; levelInfo.alpha = 0;
deathCounter.alpha = 0; deathCounter.alpha = 0;
@ -86,11 +102,10 @@ class PauseSubState extends MusicBeatSubstate
private function regenMenu():Void private function regenMenu():Void
{ {
grpMenuShit.forEachAlive(function(thing:Alphabet) while (grpMenuShit.members.length > 0)
{ {
grpMenuShit.remove(thing); grpMenuShit.remove(grpMenuShit.members[0], true);
thing.destroy(); }
});
for (i in 0...menuItems.length) for (i in 0...menuItems.length)
{ {
@ -140,6 +155,10 @@ class PauseSubState extends MusicBeatSubstate
FlxG.resetState(); FlxG.resetState();
case 'Toggle Practice Mode':
PlayState.practiceMode = !PlayState.practiceMode;
practiceText.visible = PlayState.practiceMode;
case 'Change Difficulty': case 'Change Difficulty':
menuItems = difficultyChoices; menuItems = difficultyChoices;
regenMenu(); regenMenu();

View file

@ -50,6 +50,7 @@ class PlayState extends MusicBeatState
public static var storyPlaylist:Array<String> = []; public static var storyPlaylist:Array<String> = [];
public static var storyDifficulty:Int = 1; public static var storyDifficulty:Int = 1;
public static var deathCounter:Int = 0; public static var deathCounter:Int = 0;
public static var practiceMode:Bool = false;
var halloweenLevel:Bool = false; var halloweenLevel:Bool = false;
@ -99,6 +100,8 @@ class PlayState extends MusicBeatState
var phillyTrain:FlxSprite; var phillyTrain:FlxSprite;
var trainSound:FlxSound; var trainSound:FlxSound;
var foregroundSprites:FlxTypedGroup<BGSprite>;
var limo:FlxSprite; var limo:FlxSprite;
var grpLimoDancers:FlxTypedGroup<BackgroundDancer>; var grpLimoDancers:FlxTypedGroup<BackgroundDancer>;
var fastCar:FlxSprite; var fastCar:FlxSprite;
@ -147,6 +150,8 @@ class PlayState extends MusicBeatState
Conductor.mapBPMChanges(SONG); Conductor.mapBPMChanges(SONG);
Conductor.changeBPM(SONG.bpm); Conductor.changeBPM(SONG.bpm);
foregroundSprites = new FlxTypedGroup<BGSprite>();
switch (SONG.song.toLowerCase()) switch (SONG.song.toLowerCase())
{ {
case 'tutorial': case 'tutorial':
@ -470,7 +475,7 @@ class PlayState extends MusicBeatState
*/ */
case 'guns' | 'stress' | 'ugh': case 'guns' | 'stress' | 'ugh':
// defaultCamZoom = 0.9; // defaultCamZoom = 0.95;
curStage = 'tank'; curStage = 'tank';
var bg:BGSprite = new BGSprite('tankSky', 0, -200, 0, 0); var bg:BGSprite = new BGSprite('tankSky', 0, -200, 0, 0);
@ -491,9 +496,28 @@ class PlayState extends MusicBeatState
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);
var tankGround:BGSprite = new BGSprite('tankGround', -400, -20); var tankGround:BGSprite = new BGSprite('tankGround', -200, -20);
add(tankGround); add(tankGround);
var fgTank0:BGSprite = new BGSprite('tank0', -290, 400, 1.7, 1.5, ['fg']);
foregroundSprites.add(fgTank0);
var fgTank1:BGSprite = new BGSprite('tank1', -100, 680, 2, 0.2, ['fg']);
foregroundSprites.add(fgTank1);
// just called 'foreground' just cuz small inconsistency no bbiggei
var fgTank2:BGSprite = new BGSprite('tank2', 450, 840, 1.5, 1.5, ['foreground']);
foregroundSprites.add(fgTank2);
var fgTank4:BGSprite = new BGSprite('tank4', 1000, 880, 1.5, 1.5, ['fg']);
foregroundSprites.add(fgTank4);
var fgTank5:BGSprite = new BGSprite('tank5', 1400, 600, 1.5, 1.5, ['fg']);
foregroundSprites.add(fgTank5);
var fgTank3:BGSprite = new BGSprite('tank3', 1300, 1130, 3.5, 2.5, ['fg']);
foregroundSprites.add(fgTank3);
default: default:
defaultCamZoom = 0.9; defaultCamZoom = 0.9;
curStage = 'stage'; curStage = 'stage';
@ -630,6 +654,8 @@ class PlayState extends MusicBeatState
add(dad); add(dad);
add(boyfriend); add(boyfriend);
add(foregroundSprites);
var doof:DialogueBox = new DialogueBox(false, dialogue); var doof:DialogueBox = new DialogueBox(false, dialogue);
// doof.x += 70; // doof.x += 70;
// doof.y = FlxG.height * 0.5; // doof.y = FlxG.height * 0.5;
@ -1470,7 +1496,7 @@ class PlayState extends MusicBeatState
trace("User is cheating!"); trace("User is cheating!");
} }
if (health <= 0) if (health <= 0 && !practiceMode)
{ {
boyfriend.stunned = true; boyfriend.stunned = true;
@ -2310,6 +2336,11 @@ class PlayState extends MusicBeatState
} }
} }
foregroundSprites.forEach(function(spr:BGSprite)
{
spr.dance();
});
switch (curStage) switch (curStage)
{ {
case 'school': case 'school':