1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2024-11-09 00:04:42 +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
*/
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);
loadGraphic(Paths.image(image));
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));
active = false;
}
scrollFactor.set(parX, parY);
antialiasing = true;
active = false;
}
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 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 menuItems:Array<String> = [];
@ -25,6 +31,8 @@ class PauseSubState extends MusicBeatSubstate
var pauseMusic:FlxSound;
var practiceText:FlxText;
public function new(x:Float, y:Float)
{
super();
@ -63,6 +71,14 @@ class PauseSubState extends MusicBeatSubstate
deathCounter.updateHitbox();
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;
levelInfo.alpha = 0;
deathCounter.alpha = 0;
@ -86,11 +102,10 @@ class PauseSubState extends MusicBeatSubstate
private function regenMenu():Void
{
grpMenuShit.forEachAlive(function(thing:Alphabet)
while (grpMenuShit.members.length > 0)
{
grpMenuShit.remove(thing);
thing.destroy();
});
grpMenuShit.remove(grpMenuShit.members[0], true);
}
for (i in 0...menuItems.length)
{
@ -140,6 +155,10 @@ class PauseSubState extends MusicBeatSubstate
FlxG.resetState();
case 'Toggle Practice Mode':
PlayState.practiceMode = !PlayState.practiceMode;
practiceText.visible = PlayState.practiceMode;
case 'Change Difficulty':
menuItems = difficultyChoices;
regenMenu();

View file

@ -50,6 +50,7 @@ class PlayState extends MusicBeatState
public static var storyPlaylist:Array<String> = [];
public static var storyDifficulty:Int = 1;
public static var deathCounter:Int = 0;
public static var practiceMode:Bool = false;
var halloweenLevel:Bool = false;
@ -99,6 +100,8 @@ class PlayState extends MusicBeatState
var phillyTrain:FlxSprite;
var trainSound:FlxSound;
var foregroundSprites:FlxTypedGroup<BGSprite>;
var limo:FlxSprite;
var grpLimoDancers:FlxTypedGroup<BackgroundDancer>;
var fastCar:FlxSprite;
@ -147,6 +150,8 @@ class PlayState extends MusicBeatState
Conductor.mapBPMChanges(SONG);
Conductor.changeBPM(SONG.bpm);
foregroundSprites = new FlxTypedGroup<BGSprite>();
switch (SONG.song.toLowerCase())
{
case 'tutorial':
@ -470,7 +475,7 @@ class PlayState extends MusicBeatState
*/
case 'guns' | 'stress' | 'ugh':
// defaultCamZoom = 0.9;
// defaultCamZoom = 0.95;
curStage = 'tank';
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);
add(tankWatchtower);
var tankGround:BGSprite = new BGSprite('tankGround', -400, -20);
var tankGround:BGSprite = new BGSprite('tankGround', -200, -20);
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:
defaultCamZoom = 0.9;
curStage = 'stage';
@ -630,6 +654,8 @@ class PlayState extends MusicBeatState
add(dad);
add(boyfriend);
add(foregroundSprites);
var doof:DialogueBox = new DialogueBox(false, dialogue);
// doof.x += 70;
// doof.y = FlxG.height * 0.5;
@ -1470,7 +1496,7 @@ class PlayState extends MusicBeatState
trace("User is cheating!");
}
if (health <= 0)
if (health <= 0 && !practiceMode)
{
boyfriend.stunned = true;
@ -2310,6 +2336,11 @@ class PlayState extends MusicBeatState
}
}
foregroundSprites.forEach(function(spr:BGSprite)
{
spr.dance();
});
switch (curStage)
{
case 'school':