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

This commit is contained in:
MtH 2021-04-10 02:35:21 +02:00
commit 8922adc303
3 changed files with 45 additions and 3 deletions

View file

@ -1023,6 +1023,17 @@ class PlayState extends MusicBeatState
}); });
} }
/**
* [
* [0, function(){blah;}],
* [4.6, function(){blah;}],
* [25.1, function(){blah;}],
* [30.7, function(){blah;}]
* ]
* SOMETHING LIKE THIS
*/
// var cutsceneFunctions:Array<Dynamic> = [];
function stressIntro() function stressIntro()
{ {
// for story mode shit // for story mode shit
@ -1049,11 +1060,12 @@ class PlayState extends MusicBeatState
gfTankmen.antialiasing = true; gfTankmen.antialiasing = true;
gfCutsceneLayer.add(gfTankmen); gfCutsceneLayer.add(gfTankmen);
var tankCutscene:FlxSprite = new FlxSprite(-70, 320); var tankCutscene:TankCutscene = new TankCutscene(-70, 320);
tankCutscene.frames = Paths.getSparrowAtlas('cutsceneStuff/tankTalkSong3-pt1'); tankCutscene.frames = Paths.getSparrowAtlas('cutsceneStuff/tankTalkSong3-pt1');
tankCutscene.animation.addByPrefix('tankyguy', 'TANK TALK 3 P1 UNCUT', 24, false); tankCutscene.animation.addByPrefix('tankyguy', 'TANK TALK 3 P1 UNCUT', 24, false);
// tankCutscene.animation.addByPrefix('weed', 'sexAmbig', 24, false); // tankCutscene.animation.addByPrefix('weed', 'sexAmbig', 24, false);
tankCutscene.animation.play('tankyguy'); tankCutscene.animation.play('tankyguy');
tankCutscene.antialiasing = true; tankCutscene.antialiasing = true;
bfTankCutsceneLayer.add(tankCutscene); // add(); bfTankCutsceneLayer.add(tankCutscene); // add();
@ -1142,7 +1154,10 @@ class PlayState extends MusicBeatState
}); });
} }
cutsceneSound.play(); // new FlxTimer().start(0.01, function(tmr) cutsceneSound.play()); // cutsceneSound.play();
// cutsceneSound.play();
tankCutscene.startSyncAudio = cutsceneSound;
// tankCutscene.animation.curAnim.curFrame
FlxG.camera.zoom = defaultCamZoom * 1.15; FlxG.camera.zoom = defaultCamZoom * 1.15;

27
source/TankCutscene.hx Normal file
View file

@ -0,0 +1,27 @@
package;
import flixel.FlxSprite;
import flixel.system.FlxSound;
class TankCutscene extends FlxSprite
{
public var startSyncAudio:FlxSound;
public function new(x:Float, y:Float)
{
super(x, y);
}
var startedPlayingSound:Bool = false;
override function update(elapsed:Float)
{
if (animation.curAnim.curFrame >= 1 && !startedPlayingSound)
{
startSyncAudio.play();
startedPlayingSound = true;
}
super.update(elapsed);
}
}

View file

@ -425,7 +425,7 @@ class TitleState extends MusicBeatState
} }
#if web #if web
if (!initialized && FlxG.keys.justPressed.ENTER) if (!initialized && controls.ACCEPT)
{ {
netStream.dispose(); netStream.dispose();
FlxG.stage.removeChild(video); FlxG.stage.removeChild(video);