mirror of
https://github.com/ninjamuffin99/Funkin.git
synced 2025-03-26 03:49:45 +00:00
Merge branch 'master' of github.com:ninjamuffin99/Funkin-secret into nitpix
This commit is contained in:
commit
25654c3cd6
|
@ -7,6 +7,7 @@ import flixel.math.FlxPoint;
|
||||||
import flixel.util.FlxColor;
|
import flixel.util.FlxColor;
|
||||||
import flixel.util.FlxTimer;
|
import flixel.util.FlxTimer;
|
||||||
import haxe.display.Display.Package;
|
import haxe.display.Display.Package;
|
||||||
|
import ui.PreferencesMenu;
|
||||||
|
|
||||||
class GameOverSubstate extends MusicBeatSubstate
|
class GameOverSubstate extends MusicBeatSubstate
|
||||||
{
|
{
|
||||||
|
@ -60,7 +61,12 @@ class GameOverSubstate extends MusicBeatSubstate
|
||||||
|
|
||||||
bf.playAnim('firstDeath');
|
bf.playAnim('firstDeath');
|
||||||
|
|
||||||
randomGameover = FlxG.random.int(1, 25);
|
var randomCensor:Array<Int> = [];
|
||||||
|
|
||||||
|
if (PreferencesMenu.getPref('censor-naughty'))
|
||||||
|
randomCensor = [1, 3, 8, 13, 17, 21];
|
||||||
|
|
||||||
|
randomGameover = FlxG.random.int(1, 25, randomCensor);
|
||||||
}
|
}
|
||||||
|
|
||||||
var playingDeathSound:Bool = false;
|
var playingDeathSound:Bool = false;
|
||||||
|
@ -76,6 +82,8 @@ class GameOverSubstate extends MusicBeatSubstate
|
||||||
|
|
||||||
if (controls.BACK)
|
if (controls.BACK)
|
||||||
{
|
{
|
||||||
|
PlayState.deathCounter = 0;
|
||||||
|
PlayState.seenCutscene = false;
|
||||||
FlxG.sound.music.stop();
|
FlxG.sound.music.stop();
|
||||||
|
|
||||||
if (PlayState.isStoryMode)
|
if (PlayState.isStoryMode)
|
||||||
|
|
|
@ -4,6 +4,7 @@ import flixel.FlxG;
|
||||||
import flixel.FlxSprite;
|
import flixel.FlxSprite;
|
||||||
import flixel.FlxState;
|
import flixel.FlxState;
|
||||||
import flixel.graphics.frames.FlxAtlasFrames;
|
import flixel.graphics.frames.FlxAtlasFrames;
|
||||||
|
import flixel.math.FlxMath;
|
||||||
import flixel.util.FlxTimer;
|
import flixel.util.FlxTimer;
|
||||||
import haxe.io.Path;
|
import haxe.io.Path;
|
||||||
import lime.app.Future;
|
import lime.app.Future;
|
||||||
|
@ -21,10 +22,10 @@ class LoadingState extends MusicBeatState
|
||||||
var stopMusic = false;
|
var stopMusic = false;
|
||||||
var callbacks:MultiCallback;
|
var callbacks:MultiCallback;
|
||||||
|
|
||||||
var logo:FlxSprite;
|
|
||||||
var gfDance:FlxSprite;
|
|
||||||
var danceLeft = false;
|
var danceLeft = false;
|
||||||
|
|
||||||
|
var loadBar:FlxSprite;
|
||||||
|
|
||||||
function new(target:FlxState, stopMusic:Bool)
|
function new(target:FlxState, stopMusic:Bool)
|
||||||
{
|
{
|
||||||
super();
|
super();
|
||||||
|
@ -46,6 +47,10 @@ class LoadingState extends MusicBeatState
|
||||||
funkay.scrollFactor.set();
|
funkay.scrollFactor.set();
|
||||||
funkay.screenCenter();
|
funkay.screenCenter();
|
||||||
|
|
||||||
|
loadBar = new FlxSprite(0, FlxG.height - 20).makeGraphic(FlxG.width, 10, 0xFFff16d2);
|
||||||
|
loadBar.screenCenter(X);
|
||||||
|
add(loadBar);
|
||||||
|
|
||||||
initSongsManifest().onComplete(function(lib)
|
initSongsManifest().onComplete(function(lib)
|
||||||
{
|
{
|
||||||
callbacks = new MultiCallback(onLoad);
|
callbacks = new MultiCallback(onLoad);
|
||||||
|
@ -104,18 +109,29 @@ class LoadingState extends MusicBeatState
|
||||||
{
|
{
|
||||||
super.beatHit();
|
super.beatHit();
|
||||||
|
|
||||||
logo.animation.play('bump');
|
// logo.animation.play('bump');
|
||||||
danceLeft = !danceLeft;
|
danceLeft = !danceLeft;
|
||||||
|
/*
|
||||||
if (danceLeft)
|
if (danceLeft)
|
||||||
gfDance.animation.play('danceRight');
|
gfDance.animation.play('danceRight');
|
||||||
else
|
else
|
||||||
gfDance.animation.play('danceLeft');
|
gfDance.animation.play('danceLeft'); */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var targetShit:Float = 0;
|
||||||
|
|
||||||
override function update(elapsed:Float)
|
override function update(elapsed:Float)
|
||||||
{
|
{
|
||||||
super.update(elapsed);
|
super.update(elapsed);
|
||||||
|
|
||||||
|
if (callbacks != null)
|
||||||
|
{
|
||||||
|
targetShit = FlxMath.remapToRange(callbacks.numRemaining / callbacks.length, 1, 0, 0, 1);
|
||||||
|
|
||||||
|
loadBar.scale.x = FlxMath.lerp(loadBar.scale.x, targetShit, 0.50);
|
||||||
|
FlxG.watch.addQuick('percentage?', callbacks.numRemaining / callbacks.length);
|
||||||
|
}
|
||||||
|
|
||||||
#if debug
|
#if debug
|
||||||
if (FlxG.keys.justPressed.SPACE)
|
if (FlxG.keys.justPressed.SPACE)
|
||||||
trace('fired: ' + callbacks.getFired() + " unfired:" + callbacks.getUnfired());
|
trace('fired: ' + callbacks.getFired() + " unfired:" + callbacks.getUnfired());
|
||||||
|
|
|
@ -96,7 +96,8 @@ class MainMenuState extends MusicBeatState
|
||||||
// addMenuItem('options', function () startExitState(new OptionMenu()));
|
// addMenuItem('options', function () startExitState(new OptionMenu()));
|
||||||
#if CAN_OPEN_LINKS
|
#if CAN_OPEN_LINKS
|
||||||
var hasPopupBlocker = #if web true #else false #end;
|
var hasPopupBlocker = #if web true #else false #end;
|
||||||
menuItems.createItem('donate', selectDonate, hasPopupBlocker);
|
menuItems.createItem('kickstarter', selectDonate, hasPopupBlocker);
|
||||||
|
// menuItems.createItem('donate', selectDonate, hasPopupBlocker);
|
||||||
#end
|
#end
|
||||||
menuItems.createItem('options', function() startExitState(new OptionsState()));
|
menuItems.createItem('options', function() startExitState(new OptionsState()));
|
||||||
// #if newgrounds
|
// #if newgrounds
|
||||||
|
@ -150,9 +151,12 @@ class MainMenuState extends MusicBeatState
|
||||||
function selectDonate()
|
function selectDonate()
|
||||||
{
|
{
|
||||||
#if linux
|
#if linux
|
||||||
Sys.command('/usr/bin/xdg-open', ["https://ninja-muffin24.itch.io/funkin", "&"]);
|
// Sys.command('/usr/bin/xdg-open', ["https://ninja-muffin24.itch.io/funkin", "&"]);
|
||||||
|
Sys.command('/usr/bin/xdg-open', ["https://www.kickstarter.com/projects/funkin/", "&"]);
|
||||||
#else
|
#else
|
||||||
FlxG.openURL('https://ninja-muffin24.itch.io/funkin');
|
// FlxG.openURL('https://ninja-muffin24.itch.io/funkin');
|
||||||
|
|
||||||
|
FlxG.openURL('https://www.kickstarter.com/projects/funkin/');
|
||||||
#end
|
#end
|
||||||
}
|
}
|
||||||
#end
|
#end
|
||||||
|
|
|
@ -25,6 +25,7 @@ class MenuCharacter extends FlxSprite
|
||||||
animation.addByPrefix('mom', "Mom Idle BLACK LINES", 24);
|
animation.addByPrefix('mom', "Mom Idle BLACK LINES", 24);
|
||||||
animation.addByPrefix('parents-christmas', "Parent Christmas Idle", 24);
|
animation.addByPrefix('parents-christmas', "Parent Christmas Idle", 24);
|
||||||
animation.addByPrefix('senpai', "SENPAI idle Black Lines", 24);
|
animation.addByPrefix('senpai', "SENPAI idle Black Lines", 24);
|
||||||
|
animation.addByPrefix('tankman', "Tankman Menu BLACK", 24);
|
||||||
// Parent Christmas Idle
|
// Parent Christmas Idle
|
||||||
|
|
||||||
animation.play(character);
|
animation.play(character);
|
||||||
|
|
|
@ -168,6 +168,7 @@ class PauseSubState extends MusicBeatSubstate
|
||||||
case "Restart Song":
|
case "Restart Song":
|
||||||
FlxG.resetState();
|
FlxG.resetState();
|
||||||
case "Exit to menu":
|
case "Exit to menu":
|
||||||
|
PlayState.seenCutscene = false;
|
||||||
PlayState.deathCounter = 0;
|
PlayState.deathCounter = 0;
|
||||||
if (PlayState.isStoryMode)
|
if (PlayState.isStoryMode)
|
||||||
FlxG.switchState(new StoryMenuState());
|
FlxG.switchState(new StoryMenuState());
|
||||||
|
|
|
@ -102,6 +102,8 @@ class PlayState extends MusicBeatState
|
||||||
|
|
||||||
var dialogue:Array<String> = ['blah blah blah', 'coolswag'];
|
var dialogue:Array<String> = ['blah blah blah', 'coolswag'];
|
||||||
|
|
||||||
|
public static var seenCutscene:Bool = false;
|
||||||
|
|
||||||
var halloweenBG:FlxSprite;
|
var halloweenBG:FlxSprite;
|
||||||
var isHalloween:Bool = false;
|
var isHalloween:Bool = false;
|
||||||
|
|
||||||
|
@ -149,6 +151,8 @@ class PlayState extends MusicBeatState
|
||||||
var detailsPausedText:String = "";
|
var detailsPausedText:String = "";
|
||||||
#end
|
#end
|
||||||
|
|
||||||
|
var camPos:FlxPoint;
|
||||||
|
|
||||||
override public function create()
|
override public function create()
|
||||||
{
|
{
|
||||||
if (FlxG.sound.music != null)
|
if (FlxG.sound.music != null)
|
||||||
|
@ -632,7 +636,7 @@ class PlayState extends MusicBeatState
|
||||||
|
|
||||||
dad = new Character(100, 100, SONG.player2);
|
dad = new Character(100, 100, SONG.player2);
|
||||||
|
|
||||||
var camPos:FlxPoint = new FlxPoint(dad.getGraphicMidpoint().x, dad.getGraphicMidpoint().y);
|
camPos = new FlxPoint(dad.getGraphicMidpoint().x, dad.getGraphicMidpoint().y);
|
||||||
|
|
||||||
switch (SONG.player2)
|
switch (SONG.player2)
|
||||||
{
|
{
|
||||||
|
@ -841,8 +845,10 @@ class PlayState extends MusicBeatState
|
||||||
// cameras = [FlxG.cameras.list[1]];
|
// cameras = [FlxG.cameras.list[1]];
|
||||||
startingSong = true;
|
startingSong = true;
|
||||||
|
|
||||||
if (isStoryMode)
|
if (isStoryMode && !seenCutscene)
|
||||||
{
|
{
|
||||||
|
seenCutscene = true;
|
||||||
|
|
||||||
switch (curSong.toLowerCase())
|
switch (curSong.toLowerCase())
|
||||||
{
|
{
|
||||||
case "winter-horrorland":
|
case "winter-horrorland":
|
||||||
|
@ -881,6 +887,13 @@ class PlayState extends MusicBeatState
|
||||||
case 'thorns':
|
case 'thorns':
|
||||||
schoolIntro(doof);
|
schoolIntro(doof);
|
||||||
|
|
||||||
|
case 'ugh':
|
||||||
|
ughIntro();
|
||||||
|
case 'stress':
|
||||||
|
stressIntro();
|
||||||
|
case 'guns':
|
||||||
|
gunsIntro();
|
||||||
|
|
||||||
default:
|
default:
|
||||||
startCountdown();
|
startCountdown();
|
||||||
}
|
}
|
||||||
|
@ -889,12 +902,9 @@ class PlayState extends MusicBeatState
|
||||||
{
|
{
|
||||||
switch (curSong.toLowerCase())
|
switch (curSong.toLowerCase())
|
||||||
{
|
{
|
||||||
case 'ugh':
|
// REMOVE THIS LATER
|
||||||
ughIntro();
|
|
||||||
case 'stress':
|
case 'stress':
|
||||||
stressIntro();
|
stressIntro();
|
||||||
case 'guns':
|
|
||||||
gunsIntro();
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
startCountdown();
|
startCountdown();
|
||||||
|
@ -968,6 +978,8 @@ class PlayState extends MusicBeatState
|
||||||
|
|
||||||
function gunsIntro()
|
function gunsIntro()
|
||||||
{
|
{
|
||||||
|
camFollow.setPosition(camPos.x, camPos.y);
|
||||||
|
|
||||||
camHUD.visible = false;
|
camHUD.visible = false;
|
||||||
|
|
||||||
FlxG.sound.playMusic(Paths.music('DISTORTO'), 0);
|
FlxG.sound.playMusic(Paths.music('DISTORTO'), 0);
|
||||||
|
@ -1013,6 +1025,9 @@ class PlayState extends MusicBeatState
|
||||||
|
|
||||||
function stressIntro()
|
function stressIntro()
|
||||||
{
|
{
|
||||||
|
// for story mode shit
|
||||||
|
camFollow.setPosition(camPos.x, camPos.y);
|
||||||
|
|
||||||
for (i in 0...7)
|
for (i in 0...7)
|
||||||
{
|
{
|
||||||
var dummyLoader:FlxSprite = new FlxSprite();
|
var dummyLoader:FlxSprite = new FlxSprite();
|
||||||
|
@ -1487,7 +1502,8 @@ class PlayState extends MusicBeatState
|
||||||
else
|
else
|
||||||
vocals = new FlxSound();
|
vocals = new FlxSound();
|
||||||
|
|
||||||
vocals.onComplete = function(){
|
vocals.onComplete = function()
|
||||||
|
{
|
||||||
vocalsFinished = true;
|
vocalsFinished = true;
|
||||||
};
|
};
|
||||||
FlxG.sound.list.add(vocals);
|
FlxG.sound.list.add(vocals);
|
||||||
|
@ -1775,14 +1791,14 @@ class PlayState extends MusicBeatState
|
||||||
function resyncVocals():Void
|
function resyncVocals():Void
|
||||||
{
|
{
|
||||||
if (_exiting)
|
if (_exiting)
|
||||||
return ;
|
return;
|
||||||
|
|
||||||
vocals.pause();
|
vocals.pause();
|
||||||
FlxG.sound.music.play();
|
FlxG.sound.music.play();
|
||||||
Conductor.songPosition = FlxG.sound.music.time;
|
Conductor.songPosition = FlxG.sound.music.time;
|
||||||
|
|
||||||
if (vocalsFinished)
|
if (vocalsFinished)
|
||||||
return ;
|
return;
|
||||||
|
|
||||||
vocals.time = Conductor.songPosition;
|
vocals.time = Conductor.songPosition;
|
||||||
vocals.play();
|
vocals.play();
|
||||||
|
@ -2152,6 +2168,7 @@ class PlayState extends MusicBeatState
|
||||||
|
|
||||||
function endSong():Void
|
function endSong():Void
|
||||||
{
|
{
|
||||||
|
seenCutscene = false;
|
||||||
deathCounter = 0;
|
deathCounter = 0;
|
||||||
canPause = false;
|
canPause = false;
|
||||||
FlxG.sound.music.volume = 0;
|
FlxG.sound.music.volume = 0;
|
||||||
|
|
|
@ -29,11 +29,12 @@ class StoryMenuState extends MusicBeatState
|
||||||
['Pico', 'Philly', "Blammed"],
|
['Pico', 'Philly', "Blammed"],
|
||||||
['Satin-Panties', "High", "Milf"],
|
['Satin-Panties', "High", "Milf"],
|
||||||
['Cocoa', 'Eggnog', 'Winter-Horrorland'],
|
['Cocoa', 'Eggnog', 'Winter-Horrorland'],
|
||||||
['Senpai', 'Roses', 'Thorns']
|
['Senpai', 'Roses', 'Thorns'],
|
||||||
|
['Ugh', 'Guns', 'Stress']
|
||||||
];
|
];
|
||||||
var curDifficulty:Int = 1;
|
var curDifficulty:Int = 1;
|
||||||
|
|
||||||
public static var weekUnlocked:Array<Bool> = [true, true, true, true, true, true, true];
|
public static var weekUnlocked:Array<Bool> = [true, true, true, true, true, true, true, true];
|
||||||
|
|
||||||
var weekCharacters:Array<Dynamic> = [
|
var weekCharacters:Array<Dynamic> = [
|
||||||
['dad', 'bf', 'gf'],
|
['dad', 'bf', 'gf'],
|
||||||
|
@ -42,7 +43,8 @@ class StoryMenuState extends MusicBeatState
|
||||||
['pico', 'bf', 'gf'],
|
['pico', 'bf', 'gf'],
|
||||||
['mom', 'bf', 'gf'],
|
['mom', 'bf', 'gf'],
|
||||||
['parents-christmas', 'bf', 'gf'],
|
['parents-christmas', 'bf', 'gf'],
|
||||||
['senpai', 'bf', 'gf']
|
['senpai', 'bf', 'gf'],
|
||||||
|
['tankman', 'bf', 'gf']
|
||||||
];
|
];
|
||||||
|
|
||||||
var weekNames:Array<String> = [
|
var weekNames:Array<String> = [
|
||||||
|
@ -52,7 +54,8 @@ class StoryMenuState extends MusicBeatState
|
||||||
"PICO",
|
"PICO",
|
||||||
"MOMMY MUST MURDER",
|
"MOMMY MUST MURDER",
|
||||||
"RED SNOW",
|
"RED SNOW",
|
||||||
"hating simulator ft. moawling"
|
"hating simulator ft. moawling",
|
||||||
|
"TANKMAN"
|
||||||
];
|
];
|
||||||
|
|
||||||
var txtWeekTitle:FlxText;
|
var txtWeekTitle:FlxText;
|
||||||
|
@ -112,7 +115,7 @@ class StoryMenuState extends MusicBeatState
|
||||||
add(grpLocks);
|
add(grpLocks);
|
||||||
|
|
||||||
trace("Line 70");
|
trace("Line 70");
|
||||||
|
|
||||||
#if discord_rpc
|
#if discord_rpc
|
||||||
// Updating Discord Rich Presence
|
// Updating Discord Rich Presence
|
||||||
DiscordClient.changePresence("In the Menus", null);
|
DiscordClient.changePresence("In the Menus", null);
|
||||||
|
@ -419,6 +422,9 @@ class StoryMenuState extends MusicBeatState
|
||||||
case 'dad':
|
case 'dad':
|
||||||
grpWeekCharacters.members[0].offset.set(120, 200);
|
grpWeekCharacters.members[0].offset.set(120, 200);
|
||||||
grpWeekCharacters.members[0].setGraphicSize(Std.int(grpWeekCharacters.members[0].width * 1));
|
grpWeekCharacters.members[0].setGraphicSize(Std.int(grpWeekCharacters.members[0].width * 1));
|
||||||
|
case 'tankman':
|
||||||
|
grpWeekCharacters.members[0].offset.set(60, -20);
|
||||||
|
grpWeekCharacters.members[0].setGraphicSize(Std.int(grpWeekCharacters.members[0].width * 1));
|
||||||
|
|
||||||
default:
|
default:
|
||||||
grpWeekCharacters.members[0].offset.set(100, 100);
|
grpWeekCharacters.members[0].offset.set(100, 100);
|
||||||
|
|
|
@ -23,7 +23,7 @@ class TankmenBG extends FlxSprite
|
||||||
frames = Paths.getSparrowAtlas('tankmanKilled1');
|
frames = Paths.getSparrowAtlas('tankmanKilled1');
|
||||||
antialiasing = true;
|
antialiasing = true;
|
||||||
animation.addByPrefix('run', 'tankman running', 24, true);
|
animation.addByPrefix('run', 'tankman running', 24, true);
|
||||||
animation.addByPrefix('shot', 'John', 24, false);
|
animation.addByPrefix('shot', 'John Shot ' + FlxG.random.int(1, 2), 24, false);
|
||||||
|
|
||||||
animation.play('run');
|
animation.play('run');
|
||||||
animation.curAnim.curFrame = FlxG.random.int(0, animation.curAnim.numFrames - 1);
|
animation.curAnim.curFrame = FlxG.random.int(0, animation.curAnim.numFrames - 1);
|
||||||
|
|
|
@ -20,6 +20,15 @@ import flixel.util.FlxTimer;
|
||||||
import lime.app.Application;
|
import lime.app.Application;
|
||||||
import lime.ui.Window;
|
import lime.ui.Window;
|
||||||
import openfl.Assets;
|
import openfl.Assets;
|
||||||
|
import openfl.display.Sprite;
|
||||||
|
import openfl.events.AsyncErrorEvent;
|
||||||
|
import openfl.events.AsyncErrorEvent;
|
||||||
|
import openfl.events.Event;
|
||||||
|
import openfl.events.MouseEvent;
|
||||||
|
import openfl.events.NetStatusEvent;
|
||||||
|
import openfl.media.Video;
|
||||||
|
import openfl.net.NetConnection;
|
||||||
|
import openfl.net.NetStream;
|
||||||
import shaderslmfao.ColorSwap;
|
import shaderslmfao.ColorSwap;
|
||||||
import ui.PreferencesMenu;
|
import ui.PreferencesMenu;
|
||||||
|
|
||||||
|
@ -50,6 +59,10 @@ class TitleState extends MusicBeatState
|
||||||
var swagShader:ColorSwap;
|
var swagShader:ColorSwap;
|
||||||
var thingie:FlxSprite;
|
var thingie:FlxSprite;
|
||||||
|
|
||||||
|
var video:Video;
|
||||||
|
var netStream:NetStream;
|
||||||
|
private var overlay:Sprite;
|
||||||
|
|
||||||
override public function create():Void
|
override public function create():Void
|
||||||
{
|
{
|
||||||
#if polymod
|
#if polymod
|
||||||
|
@ -96,6 +109,31 @@ class TitleState extends MusicBeatState
|
||||||
FlxG.switchState(new FreeplayState());
|
FlxG.switchState(new FreeplayState());
|
||||||
#elseif CHARTING
|
#elseif CHARTING
|
||||||
FlxG.switchState(new ChartingState());
|
FlxG.switchState(new ChartingState());
|
||||||
|
#elseif web
|
||||||
|
if (!initialized)
|
||||||
|
{
|
||||||
|
video = new Video();
|
||||||
|
FlxG.stage.addChild(video);
|
||||||
|
|
||||||
|
var netConnection = new NetConnection();
|
||||||
|
netConnection.connect(null);
|
||||||
|
|
||||||
|
netStream = new NetStream(netConnection);
|
||||||
|
netStream.client = {onMetaData: client_onMetaData};
|
||||||
|
netStream.addEventListener(AsyncErrorEvent.ASYNC_ERROR, netStream_onAsyncError);
|
||||||
|
netConnection.addEventListener(NetStatusEvent.NET_STATUS, netConnection_onNetStatus);
|
||||||
|
// netStream.addEventListener(NetStatusEvent.NET_STATUS) // netStream.play(Paths.file('music/kickstarterTrailer.mp4'));
|
||||||
|
|
||||||
|
overlay = new Sprite();
|
||||||
|
overlay.graphics.beginFill(0, 0.5);
|
||||||
|
overlay.graphics.drawRect(0, 0, 1280, 720);
|
||||||
|
overlay.addEventListener(MouseEvent.MOUSE_DOWN, overlay_onMouseDown);
|
||||||
|
|
||||||
|
overlay.buttonMode = true;
|
||||||
|
FlxG.stage.addChild(overlay);
|
||||||
|
}
|
||||||
|
|
||||||
|
// netConnection.addEventListener(MouseEvent.MOUSE_DOWN, overlay_onMouseDown);
|
||||||
#else
|
#else
|
||||||
new FlxTimer().start(1, function(tmr:FlxTimer)
|
new FlxTimer().start(1, function(tmr:FlxTimer)
|
||||||
{
|
{
|
||||||
|
@ -105,14 +143,48 @@ class TitleState extends MusicBeatState
|
||||||
|
|
||||||
#if discord_rpc
|
#if discord_rpc
|
||||||
DiscordClient.initialize();
|
DiscordClient.initialize();
|
||||||
|
|
||||||
Application.current.onExit.add (function (exitCode) {
|
Application.current.onExit.add(function(exitCode)
|
||||||
|
{
|
||||||
DiscordClient.shutdown();
|
DiscordClient.shutdown();
|
||||||
});
|
});
|
||||||
#end
|
#end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function client_onMetaData(metaData:Dynamic)
|
||||||
|
{
|
||||||
|
video.attachNetStream(netStream);
|
||||||
|
|
||||||
|
video.width = video.videoWidth;
|
||||||
|
video.height = video.videoHeight;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function netStream_onAsyncError(event:AsyncErrorEvent):Void
|
||||||
|
{
|
||||||
|
trace("Error loading video");
|
||||||
|
}
|
||||||
|
|
||||||
|
private function netConnection_onNetStatus(event:NetStatusEvent):Void
|
||||||
|
{
|
||||||
|
if (event.info.code == 'NetStream.Play.Complete')
|
||||||
|
{
|
||||||
|
netStream.dispose();
|
||||||
|
FlxG.stage.removeChild(video);
|
||||||
|
|
||||||
|
startIntro();
|
||||||
|
}
|
||||||
|
|
||||||
|
trace(event.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
private function overlay_onMouseDown(event:MouseEvent):Void
|
||||||
|
{
|
||||||
|
netStream.play(Paths.file('music/kickstarterTrailer.mp4'));
|
||||||
|
FlxG.stage.removeChild(overlay);
|
||||||
|
}
|
||||||
|
|
||||||
var logoBl:FlxSprite;
|
var logoBl:FlxSprite;
|
||||||
|
|
||||||
var gfDance:FlxSprite;
|
var gfDance:FlxSprite;
|
||||||
var danceLeft:Bool = false;
|
var danceLeft:Bool = false;
|
||||||
var titleText:FlxSprite;
|
var titleText:FlxSprite;
|
||||||
|
@ -352,8 +424,18 @@ class TitleState extends MusicBeatState
|
||||||
skipIntro();
|
skipIntro();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (FlxG.keys.justPressed.SPACE)
|
#if web
|
||||||
swagShader.hasOutline = !swagShader.hasOutline;
|
if (!initialized && FlxG.keys.justPressed.ENTER)
|
||||||
|
{
|
||||||
|
netStream.dispose();
|
||||||
|
FlxG.stage.removeChild(video);
|
||||||
|
|
||||||
|
startIntro();
|
||||||
|
}
|
||||||
|
#end
|
||||||
|
|
||||||
|
// if (FlxG.keys.justPressed.SPACE)
|
||||||
|
// swagShader.hasOutline = !swagShader.hasOutline;
|
||||||
|
|
||||||
if (controls.UI_LEFT)
|
if (controls.UI_LEFT)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue