optimiiiizeeee

This commit is contained in:
Cameron Taylor 2021-04-18 16:54:21 -04:00
parent 359300011e
commit ff5e0661b2
2 changed files with 79 additions and 73 deletions

View File

@ -649,15 +649,15 @@ class PlayState extends MusicBeatState
gf.x -= 50;
gf.y -= 200;
for (i in 0...TankmenBG.animationNotes.length)
{
if (FlxG.random.bool(16))
{
var tempTankman:TankmenBG = new TankmenBG(20, 500, true);
tempTankman.strumTime = 10;
tempTankman.resetShit(20, 600, true);
tankmanRun.add(tempTankman);
for (i in 0...TankmenBG.animationNotes.length)
{
if (FlxG.random.bool(16))
{
var tankman:TankmenBG = tankmanRun.recycle(TankmenBG);
// new TankmenBG(500, 200 + FlxG.random.int(50, 100), TankmenBG.animationNotes[i][1] < 2);
tankman.strumTime = TankmenBG.animationNotes[i][0];
@ -957,7 +957,7 @@ class PlayState extends MusicBeatState
function ughIntro()
{
inCutscene = true;
/*
var blackShit:FlxSprite = new FlxSprite(-200, -200).makeGraphic(FlxG.width * 2, FlxG.height * 2, FlxColor.BLACK);
blackShit.scrollFactor.set();
add(blackShit);
@ -975,8 +975,9 @@ class PlayState extends MusicBeatState
camFollow.x += 100;
camFollow.y += 100;
*/
/* FlxG.sound.playMusic(Paths.music('DISTORTO'), 0);
FlxG.sound.playMusic(Paths.music('DISTORTO'), 0);
FlxG.sound.music.fadeIn(5, 0, 0.5);
dad.visible = false;
@ -1036,7 +1037,7 @@ class PlayState extends MusicBeatState
camHUD.visible = true;
});
});
});*/
});
}
function gunsIntro()
@ -1935,7 +1936,7 @@ class PlayState extends MusicBeatState
vocals.pause();
FlxG.sound.music.play();
Conductor.songPosition = FlxG.sound.music.time;
Conductor.songPosition = FlxG.sound.music.time + Conductor.offset;
if (vocalsFinished)
return;
@ -1972,8 +1973,8 @@ class PlayState extends MusicBeatState
}
else
{
// Conductor.songPosition = FlxG.sound.music.time;
Conductor.songPosition += FlxG.elapsed * 1000;
Conductor.songPosition = FlxG.sound.music.time + Conductor.offset; // 20 is THE MILLISECONDS??
// Conductor.songPosition += FlxG.elapsed * 1000;
if (!paused)
{
@ -2977,8 +2978,8 @@ class PlayState extends MusicBeatState
override function stepHit()
{
super.stepHit();
if (Math.abs(FlxG.sound.music.time - Conductor.songPosition) > 20
|| (SONG.needsVoices && Math.abs(vocals.time - Conductor.songPosition) > 20))
if (Math.abs(FlxG.sound.music.time - (Conductor.songPosition - Conductor.offset)) > 20
|| (SONG.needsVoices && Math.abs(vocals.time - (Conductor.songPosition - Conductor.offset)) > 20))
{
resyncVocals();
}

View File

@ -49,6 +49,11 @@ class TankmenBG extends FlxSprite
{
super.update(elapsed);
if (x >= FlxG.width * 1.2 || x <= FlxG.width * -0.5)
visible = false;
else
visible = true;
if (animation.curAnim.name == 'run')
{
var endDirection:Float = (FlxG.width * 0.74) + endingOffset;