update now
This commit is contained in:
parent
5c7c5d20ef
commit
22886e72b1
@ -1,254 +1,254 @@
|
|||||||
package;
|
package;
|
||||||
|
|
||||||
import Controls.KeyboardScheme;
|
import Controls.KeyboardScheme;
|
||||||
import flixel.FlxG;
|
import flixel.FlxG;
|
||||||
import flixel.FlxObject;
|
import flixel.FlxObject;
|
||||||
import flixel.FlxSprite;
|
import flixel.FlxSprite;
|
||||||
import flixel.effects.FlxFlicker;
|
import flixel.effects.FlxFlicker;
|
||||||
import flixel.graphics.frames.FlxAtlasFrames;
|
import flixel.graphics.frames.FlxAtlasFrames;
|
||||||
import flixel.group.FlxGroup.FlxTypedGroup;
|
import flixel.group.FlxGroup.FlxTypedGroup;
|
||||||
import flixel.text.FlxText;
|
import flixel.text.FlxText;
|
||||||
import flixel.tweens.FlxEase;
|
import flixel.tweens.FlxEase;
|
||||||
import flixel.tweens.FlxTween;
|
import flixel.tweens.FlxTween;
|
||||||
import flixel.util.FlxColor;
|
import flixel.util.FlxColor;
|
||||||
import flixel.util.FlxTimer;
|
import flixel.util.FlxTimer;
|
||||||
import io.newgrounds.NG;
|
import io.newgrounds.NG;
|
||||||
import lime.app.Application;
|
import lime.app.Application;
|
||||||
|
|
||||||
#if windows
|
#if windows
|
||||||
import Discord.DiscordClient;
|
import Discord.DiscordClient;
|
||||||
#end
|
#end
|
||||||
|
|
||||||
using StringTools;
|
using StringTools;
|
||||||
|
|
||||||
class MainMenuState extends MusicBeatState
|
class MainMenuState extends MusicBeatState
|
||||||
{
|
{
|
||||||
var curSelected:Int = 0;
|
var curSelected:Int = 0;
|
||||||
|
|
||||||
var menuItems:FlxTypedGroup<FlxSprite>;
|
var menuItems:FlxTypedGroup<FlxSprite>;
|
||||||
|
|
||||||
#if !switch
|
#if !switch
|
||||||
var optionShit:Array<String> = ['story mode', 'freeplay', 'donate', 'options'];
|
var optionShit:Array<String> = ['story mode', 'freeplay', 'donate', 'options'];
|
||||||
#else
|
#else
|
||||||
var optionShit:Array<String> = ['story mode', 'freeplay'];
|
var optionShit:Array<String> = ['story mode', 'freeplay'];
|
||||||
#end
|
#end
|
||||||
|
|
||||||
var newGaming:FlxText;
|
var newGaming:FlxText;
|
||||||
var newGaming2:FlxText;
|
var newGaming2:FlxText;
|
||||||
var newInput:Bool = true;
|
var newInput:Bool = true;
|
||||||
|
|
||||||
public static var nightly:String = "";
|
public static var nightly:String = "";
|
||||||
|
|
||||||
public static var kadeEngineVer:String = "1.4.2" + nightly;
|
public static var kadeEngineVer:String = "1.4.2" + nightly;
|
||||||
public static var gameVer:String = "0.2.7.1";
|
public static var gameVer:String = "0.2.7.1";
|
||||||
|
|
||||||
var magenta:FlxSprite;
|
var magenta:FlxSprite;
|
||||||
var camFollow:FlxObject;
|
var camFollow:FlxObject;
|
||||||
|
|
||||||
override function create()
|
override function create()
|
||||||
{
|
{
|
||||||
#if windows
|
#if windows
|
||||||
// Updating Discord Rich Presence
|
// Updating Discord Rich Presence
|
||||||
DiscordClient.changePresence("In the Menus", null);
|
DiscordClient.changePresence("In the Menus", null);
|
||||||
#end
|
#end
|
||||||
|
|
||||||
if (!FlxG.sound.music.playing)
|
if (!FlxG.sound.music.playing)
|
||||||
{
|
{
|
||||||
FlxG.sound.playMusic(Paths.music('freakyMenu'));
|
FlxG.sound.playMusic(Paths.music('freakyMenu'));
|
||||||
}
|
}
|
||||||
|
|
||||||
persistentUpdate = persistentDraw = true;
|
persistentUpdate = persistentDraw = true;
|
||||||
|
|
||||||
var bg:FlxSprite = new FlxSprite(-80).loadGraphic(Paths.image('menuBG'));
|
var bg:FlxSprite = new FlxSprite(-80).loadGraphic(Paths.image('menuBG'));
|
||||||
bg.scrollFactor.x = 0;
|
bg.scrollFactor.x = 0;
|
||||||
bg.scrollFactor.y = 0.15;
|
bg.scrollFactor.y = 0.15;
|
||||||
bg.setGraphicSize(Std.int(bg.width * 1.1));
|
bg.setGraphicSize(Std.int(bg.width * 1.1));
|
||||||
bg.updateHitbox();
|
bg.updateHitbox();
|
||||||
bg.screenCenter();
|
bg.screenCenter();
|
||||||
bg.antialiasing = true;
|
bg.antialiasing = true;
|
||||||
add(bg);
|
add(bg);
|
||||||
|
|
||||||
camFollow = new FlxObject(0, 0, 1, 1);
|
camFollow = new FlxObject(0, 0, 1, 1);
|
||||||
add(camFollow);
|
add(camFollow);
|
||||||
|
|
||||||
magenta = new FlxSprite(-80).loadGraphic(Paths.image('menuDesat'));
|
magenta = new FlxSprite(-80).loadGraphic(Paths.image('menuDesat'));
|
||||||
magenta.scrollFactor.x = 0;
|
magenta.scrollFactor.x = 0;
|
||||||
magenta.scrollFactor.y = 0.18;
|
magenta.scrollFactor.y = 0.18;
|
||||||
magenta.setGraphicSize(Std.int(magenta.width * 1.1));
|
magenta.setGraphicSize(Std.int(magenta.width * 1.1));
|
||||||
magenta.updateHitbox();
|
magenta.updateHitbox();
|
||||||
magenta.screenCenter();
|
magenta.screenCenter();
|
||||||
magenta.visible = false;
|
magenta.visible = false;
|
||||||
magenta.antialiasing = true;
|
magenta.antialiasing = true;
|
||||||
magenta.color = 0xFFfd719b;
|
magenta.color = 0xFFfd719b;
|
||||||
add(magenta);
|
add(magenta);
|
||||||
// magenta.scrollFactor.set();
|
// magenta.scrollFactor.set();
|
||||||
|
|
||||||
menuItems = new FlxTypedGroup<FlxSprite>();
|
menuItems = new FlxTypedGroup<FlxSprite>();
|
||||||
add(menuItems);
|
add(menuItems);
|
||||||
|
|
||||||
var tex = Paths.getSparrowAtlas('FNF_main_menu_assets');
|
var tex = Paths.getSparrowAtlas('FNF_main_menu_assets');
|
||||||
|
|
||||||
for (i in 0...optionShit.length)
|
for (i in 0...optionShit.length)
|
||||||
{
|
{
|
||||||
var menuItem:FlxSprite = new FlxSprite(0, 60 + (i * 160));
|
var menuItem:FlxSprite = new FlxSprite(0, 60 + (i * 160));
|
||||||
menuItem.frames = tex;
|
menuItem.frames = tex;
|
||||||
menuItem.animation.addByPrefix('idle', optionShit[i] + " basic", 24);
|
menuItem.animation.addByPrefix('idle', optionShit[i] + " basic", 24);
|
||||||
menuItem.animation.addByPrefix('selected', optionShit[i] + " white", 24);
|
menuItem.animation.addByPrefix('selected', optionShit[i] + " white", 24);
|
||||||
menuItem.animation.play('idle');
|
menuItem.animation.play('idle');
|
||||||
menuItem.ID = i;
|
menuItem.ID = i;
|
||||||
menuItem.screenCenter(X);
|
menuItem.screenCenter(X);
|
||||||
menuItems.add(menuItem);
|
menuItems.add(menuItem);
|
||||||
menuItem.scrollFactor.set();
|
menuItem.scrollFactor.set();
|
||||||
menuItem.antialiasing = true;
|
menuItem.antialiasing = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
FlxG.camera.follow(camFollow, null, 0.60 * (60 / FlxG.save.data.fpsCap));
|
FlxG.camera.follow(camFollow, null, 0.60 * (60 / FlxG.save.data.fpsCap));
|
||||||
|
|
||||||
var versionShit:FlxText = new FlxText(5, FlxG.height - 18, 0, gameVer + (Main.watermarks ? " FNF - " + kadeEngineVer + " Kade Engine" : ""), 12);
|
var versionShit:FlxText = new FlxText(5, FlxG.height - 18, 0, gameVer + (Main.watermarks ? " FNF - " + kadeEngineVer + " Kade Engine" : ""), 12);
|
||||||
versionShit.scrollFactor.set();
|
versionShit.scrollFactor.set();
|
||||||
versionShit.setFormat("VCR OSD Mono", 16, FlxColor.WHITE, LEFT, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK);
|
versionShit.setFormat("VCR OSD Mono", 16, FlxColor.WHITE, LEFT, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK);
|
||||||
add(versionShit);
|
add(versionShit);
|
||||||
|
|
||||||
// NG.core.calls.event.logEvent('swag').send();
|
// NG.core.calls.event.logEvent('swag').send();
|
||||||
|
|
||||||
|
|
||||||
if (FlxG.save.data.dfjk)
|
if (FlxG.save.data.dfjk)
|
||||||
controls.setKeyboardScheme(KeyboardScheme.Solo, true);
|
controls.setKeyboardScheme(KeyboardScheme.Solo, true);
|
||||||
else
|
else
|
||||||
controls.setKeyboardScheme(KeyboardScheme.Duo(true), true);
|
controls.setKeyboardScheme(KeyboardScheme.Duo(true), true);
|
||||||
|
|
||||||
changeItem();
|
changeItem();
|
||||||
|
|
||||||
super.create();
|
super.create();
|
||||||
}
|
}
|
||||||
|
|
||||||
var selectedSomethin:Bool = false;
|
var selectedSomethin:Bool = false;
|
||||||
|
|
||||||
override function update(elapsed:Float)
|
override function update(elapsed:Float)
|
||||||
{
|
{
|
||||||
if (FlxG.sound.music.volume < 0.8)
|
if (FlxG.sound.music.volume < 0.8)
|
||||||
{
|
{
|
||||||
FlxG.sound.music.volume += 0.5 * FlxG.elapsed;
|
FlxG.sound.music.volume += 0.5 * FlxG.elapsed;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!selectedSomethin)
|
if (!selectedSomethin)
|
||||||
{
|
{
|
||||||
if (controls.UP_P)
|
if (controls.UP_P)
|
||||||
{
|
{
|
||||||
FlxG.sound.play(Paths.sound('scrollMenu'));
|
FlxG.sound.play(Paths.sound('scrollMenu'));
|
||||||
changeItem(-1);
|
changeItem(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (controls.DOWN_P)
|
if (controls.DOWN_P)
|
||||||
{
|
{
|
||||||
FlxG.sound.play(Paths.sound('scrollMenu'));
|
FlxG.sound.play(Paths.sound('scrollMenu'));
|
||||||
changeItem(1);
|
changeItem(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (controls.BACK)
|
if (controls.BACK)
|
||||||
{
|
{
|
||||||
FlxG.switchState(new TitleState());
|
FlxG.switchState(new TitleState());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (controls.ACCEPT)
|
if (controls.ACCEPT)
|
||||||
{
|
{
|
||||||
if (optionShit[curSelected] == 'donate')
|
if (optionShit[curSelected] == 'donate')
|
||||||
{
|
{
|
||||||
#if linux
|
#if linux
|
||||||
Sys.command('/usr/bin/xdg-open', ["https://ninja-muffin24.itch.io/funkin", "&"]);
|
Sys.command('/usr/bin/xdg-open', ["https://www.kickstarter.com/projects/funkin/friday-night-funkin-the-full-ass-game", "&"]);
|
||||||
#else
|
#else
|
||||||
FlxG.openURL('https://ninja-muffin24.itch.io/funkin');
|
FlxG.openURL('https://www.kickstarter.com/projects/funkin/friday-night-funkin-the-full-ass-game');
|
||||||
#end
|
#end
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
selectedSomethin = true;
|
selectedSomethin = true;
|
||||||
FlxG.sound.play(Paths.sound('confirmMenu'));
|
FlxG.sound.play(Paths.sound('confirmMenu'));
|
||||||
|
|
||||||
if (FlxG.save.data.flashing)
|
if (FlxG.save.data.flashing)
|
||||||
FlxFlicker.flicker(magenta, 1.1, 0.15, false);
|
FlxFlicker.flicker(magenta, 1.1, 0.15, false);
|
||||||
|
|
||||||
menuItems.forEach(function(spr:FlxSprite)
|
menuItems.forEach(function(spr:FlxSprite)
|
||||||
{
|
{
|
||||||
if (curSelected != spr.ID)
|
if (curSelected != spr.ID)
|
||||||
{
|
{
|
||||||
FlxTween.tween(spr, {alpha: 0}, 1.3, {
|
FlxTween.tween(spr, {alpha: 0}, 1.3, {
|
||||||
ease: FlxEase.quadOut,
|
ease: FlxEase.quadOut,
|
||||||
onComplete: function(twn:FlxTween)
|
onComplete: function(twn:FlxTween)
|
||||||
{
|
{
|
||||||
spr.kill();
|
spr.kill();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (FlxG.save.data.flashing)
|
if (FlxG.save.data.flashing)
|
||||||
{
|
{
|
||||||
FlxFlicker.flicker(spr, 1, 0.06, false, false, function(flick:FlxFlicker)
|
FlxFlicker.flicker(spr, 1, 0.06, false, false, function(flick:FlxFlicker)
|
||||||
{
|
{
|
||||||
goToState();
|
goToState();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
new FlxTimer().start(1, function(tmr:FlxTimer)
|
new FlxTimer().start(1, function(tmr:FlxTimer)
|
||||||
{
|
{
|
||||||
goToState();
|
goToState();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
super.update(elapsed);
|
super.update(elapsed);
|
||||||
|
|
||||||
menuItems.forEach(function(spr:FlxSprite)
|
menuItems.forEach(function(spr:FlxSprite)
|
||||||
{
|
{
|
||||||
spr.screenCenter(X);
|
spr.screenCenter(X);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function goToState()
|
function goToState()
|
||||||
{
|
{
|
||||||
var daChoice:String = optionShit[curSelected];
|
var daChoice:String = optionShit[curSelected];
|
||||||
|
|
||||||
switch (daChoice)
|
switch (daChoice)
|
||||||
{
|
{
|
||||||
case 'story mode':
|
case 'story mode':
|
||||||
FlxG.switchState(new StoryMenuState());
|
FlxG.switchState(new StoryMenuState());
|
||||||
trace("Story Menu Selected");
|
trace("Story Menu Selected");
|
||||||
case 'freeplay':
|
case 'freeplay':
|
||||||
FlxG.switchState(new FreeplayState());
|
FlxG.switchState(new FreeplayState());
|
||||||
|
|
||||||
trace("Freeplay Menu Selected");
|
trace("Freeplay Menu Selected");
|
||||||
|
|
||||||
case 'options':
|
case 'options':
|
||||||
FlxG.switchState(new OptionsMenu());
|
FlxG.switchState(new OptionsMenu());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function changeItem(huh:Int = 0)
|
function changeItem(huh:Int = 0)
|
||||||
{
|
{
|
||||||
curSelected += huh;
|
curSelected += huh;
|
||||||
|
|
||||||
if (curSelected >= menuItems.length)
|
if (curSelected >= menuItems.length)
|
||||||
curSelected = 0;
|
curSelected = 0;
|
||||||
if (curSelected < 0)
|
if (curSelected < 0)
|
||||||
curSelected = menuItems.length - 1;
|
curSelected = menuItems.length - 1;
|
||||||
|
|
||||||
menuItems.forEach(function(spr:FlxSprite)
|
menuItems.forEach(function(spr:FlxSprite)
|
||||||
{
|
{
|
||||||
spr.animation.play('idle');
|
spr.animation.play('idle');
|
||||||
|
|
||||||
if (spr.ID == curSelected)
|
if (spr.ID == curSelected)
|
||||||
{
|
{
|
||||||
spr.animation.play('selected');
|
spr.animation.play('selected');
|
||||||
camFollow.setPosition(spr.getGraphicMidpoint().x, spr.getGraphicMidpoint().y);
|
camFollow.setPosition(spr.getGraphicMidpoint().x, spr.getGraphicMidpoint().y);
|
||||||
}
|
}
|
||||||
|
|
||||||
spr.updateHitbox();
|
spr.updateHitbox();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,45 +1,98 @@
|
|||||||
package;
|
package;
|
||||||
|
|
||||||
import flixel.FlxG;
|
import flixel.FlxG;
|
||||||
import flixel.FlxSprite;
|
import flixel.FlxSprite;
|
||||||
import flixel.FlxSubState;
|
import flixel.FlxSubState;
|
||||||
import flixel.text.FlxText;
|
import flixel.text.FlxText;
|
||||||
import flixel.util.FlxColor;
|
import flixel.tweens.FlxEase;
|
||||||
import lime.app.Application;
|
import flixel.tweens.FlxTween;
|
||||||
|
import flixel.util.FlxColor;
|
||||||
class OutdatedSubState extends MusicBeatState
|
import flixel.util.FlxTimer;
|
||||||
{
|
import lime.app.Application;
|
||||||
public static var leftState:Bool = false;
|
|
||||||
|
class OutdatedSubState extends MusicBeatState
|
||||||
public static var needVer:String = "IDFK LOL";
|
{
|
||||||
|
public static var leftState:Bool = false;
|
||||||
override function create()
|
|
||||||
{
|
public static var needVer:String = "IDFK LOL";
|
||||||
super.create();
|
public static var currChanges:String = "dk";
|
||||||
var bg:FlxSprite = new FlxSprite().makeGraphic(FlxG.width, FlxG.height, FlxColor.BLACK);
|
|
||||||
add(bg);
|
private var bgColors:Array<String> = [
|
||||||
var txt:FlxText = new FlxText(0, 0, FlxG.width,
|
'#314d7f',
|
||||||
"Kade Engine is Outdated!\n"
|
'#4e7093',
|
||||||
+ MainMenuState.kadeEngineVer
|
'#70526e',
|
||||||
+ " is your current version\nwhile the most recent version is " + needVer
|
'#594465'
|
||||||
+ "!\nPress Space to go to the github or ESCAPE to ignore this!!",
|
];
|
||||||
32);
|
private var colorRotation:Int = 1;
|
||||||
txt.setFormat("VCR OSD Mono", 32, FlxColor.WHITE, CENTER);
|
|
||||||
txt.screenCenter();
|
override function create()
|
||||||
add(txt);
|
{
|
||||||
}
|
super.create();
|
||||||
|
var bg:FlxSprite = new FlxSprite().loadGraphic(Paths.image('week54prototype', 'shared'));
|
||||||
override function update(elapsed:Float)
|
bg.scale.x *= 1.55;
|
||||||
{
|
bg.scale.y *= 1.55;
|
||||||
if (controls.ACCEPT)
|
bg.screenCenter();
|
||||||
{
|
add(bg);
|
||||||
FlxG.openURL("https://github.com/KadeDev/Kade-Engine/releases/latest");
|
|
||||||
}
|
var kadeLogo:FlxSprite = new FlxSprite(FlxG.width, 0).loadGraphic(Paths.image('KadeEngineLogo'));
|
||||||
if (controls.BACK)
|
kadeLogo.scale.y = 0.3;
|
||||||
{
|
kadeLogo.scale.x = 0.3;
|
||||||
leftState = true;
|
kadeLogo.x -= kadeLogo.frameHeight;
|
||||||
FlxG.switchState(new MainMenuState());
|
kadeLogo.y -= 180;
|
||||||
}
|
kadeLogo.alpha = 0.8;
|
||||||
super.update(elapsed);
|
add(kadeLogo);
|
||||||
}
|
|
||||||
}
|
var txt:FlxText = new FlxText(0, 0, FlxG.width,
|
||||||
|
"Kade Engine is Outdated!\n"
|
||||||
|
+ MainMenuState.kadeEngineVer
|
||||||
|
+ " is your current version\nwhile the most recent version is " + needVer + "!"
|
||||||
|
+ "\n\nWhat's new\n\n"
|
||||||
|
+ currChanges
|
||||||
|
+ "\n\n...Bug fixes and other changes included!"
|
||||||
|
+ "\nPress Space to go to Github or ESCAPE to ignore this!!",
|
||||||
|
32);
|
||||||
|
|
||||||
|
txt.setFormat("VCR OSD Mono", 32, FlxColor.fromRGB(200, 200, 200), CENTER);
|
||||||
|
txt.borderColor = FlxColor.BLACK;
|
||||||
|
txt.borderSize = 3;
|
||||||
|
txt.borderStyle = FlxTextBorderStyle.OUTLINE;
|
||||||
|
txt.screenCenter();
|
||||||
|
add(txt);
|
||||||
|
|
||||||
|
FlxTween.color(bg, 2, bg.color, FlxColor.fromString(bgColors[colorRotation]));
|
||||||
|
FlxTween.angle(kadeLogo, kadeLogo.angle, -10, 2, {ease: FlxEase.quartInOut});
|
||||||
|
|
||||||
|
new FlxTimer().start(2, function(tmr:FlxTimer)
|
||||||
|
{
|
||||||
|
FlxTween.color(bg, 2, bg.color, FlxColor.fromString(bgColors[colorRotation]));
|
||||||
|
if(colorRotation < (bgColors.length - 1)) colorRotation++;
|
||||||
|
else colorRotation = 0;
|
||||||
|
}, 0);
|
||||||
|
|
||||||
|
new FlxTimer().start(2, function(tmr:FlxTimer)
|
||||||
|
{
|
||||||
|
if(kadeLogo.angle == -10) FlxTween.angle(kadeLogo, kadeLogo.angle, 10, 2, {ease: FlxEase.quartInOut});
|
||||||
|
else FlxTween.angle(kadeLogo, kadeLogo.angle, -10, 2, {ease: FlxEase.quartInOut});
|
||||||
|
}, 0);
|
||||||
|
|
||||||
|
new FlxTimer().start(0.8, function(tmr:FlxTimer)
|
||||||
|
{
|
||||||
|
if(kadeLogo.alpha == 0.8) FlxTween.tween(kadeLogo, {alpha: 1}, 0.8, {ease: FlxEase.quartInOut});
|
||||||
|
else FlxTween.tween(kadeLogo, {alpha: 0.8}, 0.8, {ease: FlxEase.quartInOut});
|
||||||
|
}, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
override function update(elapsed:Float)
|
||||||
|
{
|
||||||
|
if (controls.ACCEPT)
|
||||||
|
{
|
||||||
|
FlxG.openURL("https://kadedev.github.io/Kade-Engine/");
|
||||||
|
}
|
||||||
|
if (controls.BACK)
|
||||||
|
{
|
||||||
|
leftState = true;
|
||||||
|
FlxG.switchState(new MainMenuState());
|
||||||
|
}
|
||||||
|
super.update(elapsed);
|
||||||
|
}
|
||||||
|
}
|
@ -1,464 +1,467 @@
|
|||||||
package;
|
package;
|
||||||
|
|
||||||
import flixel.FlxG;
|
import flixel.FlxG;
|
||||||
import flixel.FlxSprite;
|
import flixel.FlxSprite;
|
||||||
import flixel.FlxState;
|
import flixel.FlxState;
|
||||||
import flixel.addons.display.FlxGridOverlay;
|
import flixel.addons.display.FlxGridOverlay;
|
||||||
import flixel.addons.transition.FlxTransitionSprite.GraphicTransTileDiamond;
|
import flixel.addons.transition.FlxTransitionSprite.GraphicTransTileDiamond;
|
||||||
import flixel.addons.transition.FlxTransitionableState;
|
import flixel.addons.transition.FlxTransitionableState;
|
||||||
import flixel.addons.transition.TransitionData;
|
import flixel.addons.transition.TransitionData;
|
||||||
import flixel.graphics.FlxGraphic;
|
import flixel.graphics.FlxGraphic;
|
||||||
import flixel.graphics.frames.FlxAtlasFrames;
|
import flixel.graphics.frames.FlxAtlasFrames;
|
||||||
import flixel.group.FlxGroup;
|
import flixel.group.FlxGroup;
|
||||||
import flixel.input.gamepad.FlxGamepad;
|
import flixel.input.gamepad.FlxGamepad;
|
||||||
import flixel.math.FlxPoint;
|
import flixel.math.FlxPoint;
|
||||||
import flixel.math.FlxRect;
|
import flixel.math.FlxRect;
|
||||||
import flixel.system.FlxSound;
|
import flixel.system.FlxSound;
|
||||||
import flixel.system.ui.FlxSoundTray;
|
import flixel.system.ui.FlxSoundTray;
|
||||||
import flixel.text.FlxText;
|
import flixel.text.FlxText;
|
||||||
import flixel.tweens.FlxEase;
|
import flixel.tweens.FlxEase;
|
||||||
import flixel.tweens.FlxTween;
|
import flixel.tweens.FlxTween;
|
||||||
import flixel.util.FlxColor;
|
import flixel.util.FlxColor;
|
||||||
import flixel.util.FlxTimer;
|
import flixel.util.FlxTimer;
|
||||||
import io.newgrounds.NG;
|
import io.newgrounds.NG;
|
||||||
import lime.app.Application;
|
import lime.app.Application;
|
||||||
import openfl.Assets;
|
import openfl.Assets;
|
||||||
|
|
||||||
#if windows
|
#if windows
|
||||||
import Discord.DiscordClient;
|
import Discord.DiscordClient;
|
||||||
#end
|
#end
|
||||||
|
|
||||||
#if cpp
|
#if cpp
|
||||||
import sys.thread.Thread;
|
import sys.thread.Thread;
|
||||||
#end
|
#end
|
||||||
|
|
||||||
using StringTools;
|
using StringTools;
|
||||||
|
|
||||||
class TitleState extends MusicBeatState
|
class TitleState extends MusicBeatState
|
||||||
{
|
{
|
||||||
static var initialized:Bool = false;
|
static var initialized:Bool = false;
|
||||||
|
|
||||||
var blackScreen:FlxSprite;
|
var blackScreen:FlxSprite;
|
||||||
var credGroup:FlxGroup;
|
var credGroup:FlxGroup;
|
||||||
var credTextShit:Alphabet;
|
var credTextShit:Alphabet;
|
||||||
var textGroup:FlxGroup;
|
var textGroup:FlxGroup;
|
||||||
var ngSpr:FlxSprite;
|
var ngSpr:FlxSprite;
|
||||||
|
|
||||||
var curWacky:Array<String> = [];
|
var curWacky:Array<String> = [];
|
||||||
|
|
||||||
var wackyImage:FlxSprite;
|
var wackyImage:FlxSprite;
|
||||||
|
|
||||||
override public function create():Void
|
override public function create():Void
|
||||||
{
|
{
|
||||||
#if polymod
|
#if polymod
|
||||||
polymod.Polymod.init({modRoot: "mods", dirs: ['introMod']});
|
polymod.Polymod.init({modRoot: "mods", dirs: ['introMod']});
|
||||||
#end
|
#end
|
||||||
|
|
||||||
#if sys
|
#if sys
|
||||||
if (!sys.FileSystem.exists(Sys.getCwd() + "/assets/replays"))
|
if (!sys.FileSystem.exists(Sys.getCwd() + "/assets/replays"))
|
||||||
sys.FileSystem.createDirectory(Sys.getCwd() + "/assets/replays");
|
sys.FileSystem.createDirectory(Sys.getCwd() + "/assets/replays");
|
||||||
#end
|
#end
|
||||||
|
|
||||||
@:privateAccess
|
@:privateAccess
|
||||||
{
|
{
|
||||||
trace("Loaded " + openfl.Assets.getLibrary("default").assetsLoaded + " assets (DEFAULT)");
|
trace("Loaded " + openfl.Assets.getLibrary("default").assetsLoaded + " assets (DEFAULT)");
|
||||||
}
|
}
|
||||||
|
|
||||||
PlayerSettings.init();
|
PlayerSettings.init();
|
||||||
|
|
||||||
#if windows
|
#if windows
|
||||||
DiscordClient.initialize();
|
DiscordClient.initialize();
|
||||||
|
|
||||||
Application.current.onExit.add (function (exitCode) {
|
Application.current.onExit.add (function (exitCode) {
|
||||||
DiscordClient.shutdown();
|
DiscordClient.shutdown();
|
||||||
});
|
});
|
||||||
|
|
||||||
#end
|
#end
|
||||||
|
|
||||||
curWacky = FlxG.random.getObject(getIntroTextShit());
|
curWacky = FlxG.random.getObject(getIntroTextShit());
|
||||||
|
|
||||||
// DEBUG BULLSHIT
|
// DEBUG BULLSHIT
|
||||||
|
|
||||||
super.create();
|
super.create();
|
||||||
|
|
||||||
// NGio.noLogin(APIStuff.API);
|
// NGio.noLogin(APIStuff.API);
|
||||||
|
|
||||||
#if ng
|
#if ng
|
||||||
var ng:NGio = new NGio(APIStuff.API, APIStuff.EncKey);
|
var ng:NGio = new NGio(APIStuff.API, APIStuff.EncKey);
|
||||||
trace('NEWGROUNDS LOL');
|
trace('NEWGROUNDS LOL');
|
||||||
#end
|
#end
|
||||||
|
|
||||||
FlxG.save.bind('funkin', 'ninjamuffin99');
|
FlxG.save.bind('funkin', 'ninjamuffin99');
|
||||||
|
|
||||||
KadeEngineData.initSave();
|
KadeEngineData.initSave();
|
||||||
|
|
||||||
Highscore.load();
|
Highscore.load();
|
||||||
|
|
||||||
if (FlxG.save.data.weekUnlocked != null)
|
if (FlxG.save.data.weekUnlocked != null)
|
||||||
{
|
{
|
||||||
// FIX LATER!!!
|
// FIX LATER!!!
|
||||||
// WEEK UNLOCK PROGRESSION!!
|
// WEEK UNLOCK PROGRESSION!!
|
||||||
// StoryMenuState.weekUnlocked = FlxG.save.data.weekUnlocked;
|
// StoryMenuState.weekUnlocked = FlxG.save.data.weekUnlocked;
|
||||||
|
|
||||||
if (StoryMenuState.weekUnlocked.length < 4)
|
if (StoryMenuState.weekUnlocked.length < 4)
|
||||||
StoryMenuState.weekUnlocked.insert(0, true);
|
StoryMenuState.weekUnlocked.insert(0, true);
|
||||||
|
|
||||||
// QUICK PATCH OOPS!
|
// QUICK PATCH OOPS!
|
||||||
if (!StoryMenuState.weekUnlocked[0])
|
if (!StoryMenuState.weekUnlocked[0])
|
||||||
StoryMenuState.weekUnlocked[0] = true;
|
StoryMenuState.weekUnlocked[0] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if FREEPLAY
|
#if FREEPLAY
|
||||||
FlxG.switchState(new FreeplayState());
|
FlxG.switchState(new FreeplayState());
|
||||||
#elseif CHARTING
|
#elseif CHARTING
|
||||||
FlxG.switchState(new ChartingState());
|
FlxG.switchState(new ChartingState());
|
||||||
#else
|
#else
|
||||||
new FlxTimer().start(1, function(tmr:FlxTimer)
|
new FlxTimer().start(1, function(tmr:FlxTimer)
|
||||||
{
|
{
|
||||||
startIntro();
|
startIntro();
|
||||||
});
|
});
|
||||||
#end
|
#end
|
||||||
}
|
}
|
||||||
|
|
||||||
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;
|
||||||
|
|
||||||
function startIntro()
|
function startIntro()
|
||||||
{
|
{
|
||||||
if (!initialized)
|
if (!initialized)
|
||||||
{
|
{
|
||||||
var diamond:FlxGraphic = FlxGraphic.fromClass(GraphicTransTileDiamond);
|
var diamond:FlxGraphic = FlxGraphic.fromClass(GraphicTransTileDiamond);
|
||||||
diamond.persist = true;
|
diamond.persist = true;
|
||||||
diamond.destroyOnNoUse = false;
|
diamond.destroyOnNoUse = false;
|
||||||
|
|
||||||
FlxTransitionableState.defaultTransIn = new TransitionData(FADE, FlxColor.BLACK, 1, new FlxPoint(0, -1), {asset: diamond, width: 32, height: 32},
|
FlxTransitionableState.defaultTransIn = new TransitionData(FADE, FlxColor.BLACK, 1, new FlxPoint(0, -1), {asset: diamond, width: 32, height: 32},
|
||||||
new FlxRect(-200, -200, FlxG.width * 1.4, FlxG.height * 1.4));
|
new FlxRect(-200, -200, FlxG.width * 1.4, FlxG.height * 1.4));
|
||||||
FlxTransitionableState.defaultTransOut = new TransitionData(FADE, FlxColor.BLACK, 0.7, new FlxPoint(0, 1),
|
FlxTransitionableState.defaultTransOut = new TransitionData(FADE, FlxColor.BLACK, 0.7, new FlxPoint(0, 1),
|
||||||
{asset: diamond, width: 32, height: 32}, new FlxRect(-200, -200, FlxG.width * 1.4, FlxG.height * 1.4));
|
{asset: diamond, width: 32, height: 32}, new FlxRect(-200, -200, FlxG.width * 1.4, FlxG.height * 1.4));
|
||||||
|
|
||||||
transIn = FlxTransitionableState.defaultTransIn;
|
transIn = FlxTransitionableState.defaultTransIn;
|
||||||
transOut = FlxTransitionableState.defaultTransOut;
|
transOut = FlxTransitionableState.defaultTransOut;
|
||||||
|
|
||||||
// HAD TO MODIFY SOME BACKEND SHIT
|
// HAD TO MODIFY SOME BACKEND SHIT
|
||||||
// IF THIS PR IS HERE IF ITS ACCEPTED UR GOOD TO GO
|
// IF THIS PR IS HERE IF ITS ACCEPTED UR GOOD TO GO
|
||||||
// https://github.com/HaxeFlixel/flixel-addons/pull/348
|
// https://github.com/HaxeFlixel/flixel-addons/pull/348
|
||||||
|
|
||||||
// var music:FlxSound = new FlxSound();
|
// var music:FlxSound = new FlxSound();
|
||||||
// music.loadStream(Paths.music('freakyMenu'));
|
// music.loadStream(Paths.music('freakyMenu'));
|
||||||
// FlxG.sound.list.add(music);
|
// FlxG.sound.list.add(music);
|
||||||
// music.play();
|
// music.play();
|
||||||
FlxG.sound.playMusic(Paths.music('freakyMenu'), 0);
|
FlxG.sound.playMusic(Paths.music('freakyMenu'), 0);
|
||||||
|
|
||||||
FlxG.sound.music.fadeIn(4, 0, 0.7);
|
FlxG.sound.music.fadeIn(4, 0, 0.7);
|
||||||
}
|
}
|
||||||
|
|
||||||
Conductor.changeBPM(102);
|
Conductor.changeBPM(102);
|
||||||
persistentUpdate = true;
|
persistentUpdate = true;
|
||||||
|
|
||||||
var bg:FlxSprite = new FlxSprite().makeGraphic(FlxG.width, FlxG.height, FlxColor.BLACK);
|
var bg:FlxSprite = new FlxSprite().makeGraphic(FlxG.width, FlxG.height, FlxColor.BLACK);
|
||||||
// bg.antialiasing = true;
|
// bg.antialiasing = true;
|
||||||
// bg.setGraphicSize(Std.int(bg.width * 0.6));
|
// bg.setGraphicSize(Std.int(bg.width * 0.6));
|
||||||
// bg.updateHitbox();
|
// bg.updateHitbox();
|
||||||
add(bg);
|
add(bg);
|
||||||
|
|
||||||
logoBl = new FlxSprite(-150, -100);
|
logoBl = new FlxSprite(-150, -100);
|
||||||
logoBl.frames = Paths.getSparrowAtlas('logoBumpin');
|
logoBl.frames = Paths.getSparrowAtlas('logoBumpin');
|
||||||
logoBl.antialiasing = true;
|
logoBl.antialiasing = true;
|
||||||
logoBl.animation.addByPrefix('bump', 'logo bumpin', 24);
|
logoBl.animation.addByPrefix('bump', 'logo bumpin', 24);
|
||||||
logoBl.animation.play('bump');
|
logoBl.animation.play('bump');
|
||||||
logoBl.updateHitbox();
|
logoBl.updateHitbox();
|
||||||
// logoBl.screenCenter();
|
// logoBl.screenCenter();
|
||||||
// logoBl.color = FlxColor.BLACK;
|
// logoBl.color = FlxColor.BLACK;
|
||||||
|
|
||||||
gfDance = new FlxSprite(FlxG.width * 0.4, FlxG.height * 0.07);
|
gfDance = new FlxSprite(FlxG.width * 0.4, FlxG.height * 0.07);
|
||||||
gfDance.frames = Paths.getSparrowAtlas('gfDanceTitle');
|
gfDance.frames = Paths.getSparrowAtlas('gfDanceTitle');
|
||||||
gfDance.animation.addByIndices('danceLeft', 'gfDance', [30, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14], "", 24, false);
|
gfDance.animation.addByIndices('danceLeft', 'gfDance', [30, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14], "", 24, false);
|
||||||
gfDance.animation.addByIndices('danceRight', 'gfDance', [15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29], "", 24, false);
|
gfDance.animation.addByIndices('danceRight', 'gfDance', [15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29], "", 24, false);
|
||||||
gfDance.antialiasing = true;
|
gfDance.antialiasing = true;
|
||||||
add(gfDance);
|
add(gfDance);
|
||||||
add(logoBl);
|
add(logoBl);
|
||||||
|
|
||||||
titleText = new FlxSprite(100, FlxG.height * 0.8);
|
titleText = new FlxSprite(100, FlxG.height * 0.8);
|
||||||
titleText.frames = Paths.getSparrowAtlas('titleEnter');
|
titleText.frames = Paths.getSparrowAtlas('titleEnter');
|
||||||
titleText.animation.addByPrefix('idle', "Press Enter to Begin", 24);
|
titleText.animation.addByPrefix('idle', "Press Enter to Begin", 24);
|
||||||
titleText.animation.addByPrefix('press', "ENTER PRESSED", 24);
|
titleText.animation.addByPrefix('press', "ENTER PRESSED", 24);
|
||||||
titleText.antialiasing = true;
|
titleText.antialiasing = true;
|
||||||
titleText.animation.play('idle');
|
titleText.animation.play('idle');
|
||||||
titleText.updateHitbox();
|
titleText.updateHitbox();
|
||||||
// titleText.screenCenter(X);
|
// titleText.screenCenter(X);
|
||||||
add(titleText);
|
add(titleText);
|
||||||
|
|
||||||
var logo:FlxSprite = new FlxSprite().loadGraphic(Paths.image('logo'));
|
var logo:FlxSprite = new FlxSprite().loadGraphic(Paths.image('logo'));
|
||||||
logo.screenCenter();
|
logo.screenCenter();
|
||||||
logo.antialiasing = true;
|
logo.antialiasing = true;
|
||||||
// add(logo);
|
// add(logo);
|
||||||
|
|
||||||
// FlxTween.tween(logoBl, {y: logoBl.y + 50}, 0.6, {ease: FlxEase.quadInOut, type: PINGPONG});
|
// FlxTween.tween(logoBl, {y: logoBl.y + 50}, 0.6, {ease: FlxEase.quadInOut, type: PINGPONG});
|
||||||
// FlxTween.tween(logo, {y: logoBl.y + 50}, 0.6, {ease: FlxEase.quadInOut, type: PINGPONG, startDelay: 0.1});
|
// FlxTween.tween(logo, {y: logoBl.y + 50}, 0.6, {ease: FlxEase.quadInOut, type: PINGPONG, startDelay: 0.1});
|
||||||
|
|
||||||
credGroup = new FlxGroup();
|
credGroup = new FlxGroup();
|
||||||
add(credGroup);
|
add(credGroup);
|
||||||
textGroup = new FlxGroup();
|
textGroup = new FlxGroup();
|
||||||
|
|
||||||
blackScreen = new FlxSprite().makeGraphic(FlxG.width, FlxG.height, FlxColor.BLACK);
|
blackScreen = new FlxSprite().makeGraphic(FlxG.width, FlxG.height, FlxColor.BLACK);
|
||||||
credGroup.add(blackScreen);
|
credGroup.add(blackScreen);
|
||||||
|
|
||||||
credTextShit = new Alphabet(0, 0, "ninjamuffin99\nPhantomArcade\nkawaisprite\nevilsk8er", true);
|
credTextShit = new Alphabet(0, 0, "ninjamuffin99\nPhantomArcade\nkawaisprite\nevilsk8er", true);
|
||||||
credTextShit.screenCenter();
|
credTextShit.screenCenter();
|
||||||
|
|
||||||
// credTextShit.alignment = CENTER;
|
// credTextShit.alignment = CENTER;
|
||||||
|
|
||||||
credTextShit.visible = false;
|
credTextShit.visible = false;
|
||||||
|
|
||||||
ngSpr = new FlxSprite(0, FlxG.height * 0.52).loadGraphic(Paths.image('newgrounds_logo'));
|
ngSpr = new FlxSprite(0, FlxG.height * 0.52).loadGraphic(Paths.image('newgrounds_logo'));
|
||||||
add(ngSpr);
|
add(ngSpr);
|
||||||
ngSpr.visible = false;
|
ngSpr.visible = false;
|
||||||
ngSpr.setGraphicSize(Std.int(ngSpr.width * 0.8));
|
ngSpr.setGraphicSize(Std.int(ngSpr.width * 0.8));
|
||||||
ngSpr.updateHitbox();
|
ngSpr.updateHitbox();
|
||||||
ngSpr.screenCenter(X);
|
ngSpr.screenCenter(X);
|
||||||
ngSpr.antialiasing = true;
|
ngSpr.antialiasing = true;
|
||||||
|
|
||||||
FlxTween.tween(credTextShit, {y: credTextShit.y + 20}, 2.9, {ease: FlxEase.quadInOut, type: PINGPONG});
|
FlxTween.tween(credTextShit, {y: credTextShit.y + 20}, 2.9, {ease: FlxEase.quadInOut, type: PINGPONG});
|
||||||
|
|
||||||
FlxG.mouse.visible = false;
|
FlxG.mouse.visible = false;
|
||||||
|
|
||||||
if (initialized)
|
if (initialized)
|
||||||
skipIntro();
|
skipIntro();
|
||||||
else
|
else
|
||||||
initialized = true;
|
initialized = true;
|
||||||
|
|
||||||
// credGroup.add(credTextShit);
|
// credGroup.add(credTextShit);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getIntroTextShit():Array<Array<String>>
|
function getIntroTextShit():Array<Array<String>>
|
||||||
{
|
{
|
||||||
var fullText:String = Assets.getText(Paths.txt('introText'));
|
var fullText:String = Assets.getText(Paths.txt('introText'));
|
||||||
|
|
||||||
var firstArray:Array<String> = fullText.split('\n');
|
var firstArray:Array<String> = fullText.split('\n');
|
||||||
var swagGoodArray:Array<Array<String>> = [];
|
var swagGoodArray:Array<Array<String>> = [];
|
||||||
|
|
||||||
for (i in firstArray)
|
for (i in firstArray)
|
||||||
{
|
{
|
||||||
swagGoodArray.push(i.split('--'));
|
swagGoodArray.push(i.split('--'));
|
||||||
}
|
}
|
||||||
|
|
||||||
return swagGoodArray;
|
return swagGoodArray;
|
||||||
}
|
}
|
||||||
|
|
||||||
var transitioning:Bool = false;
|
var transitioning:Bool = false;
|
||||||
|
|
||||||
override function update(elapsed:Float)
|
override function update(elapsed:Float)
|
||||||
{
|
{
|
||||||
if (FlxG.sound.music != null)
|
if (FlxG.sound.music != null)
|
||||||
Conductor.songPosition = FlxG.sound.music.time;
|
Conductor.songPosition = FlxG.sound.music.time;
|
||||||
// FlxG.watch.addQuick('amp', FlxG.sound.music.amplitude);
|
// FlxG.watch.addQuick('amp', FlxG.sound.music.amplitude);
|
||||||
|
|
||||||
if (FlxG.keys.justPressed.F)
|
if (FlxG.keys.justPressed.F)
|
||||||
{
|
{
|
||||||
FlxG.fullscreen = !FlxG.fullscreen;
|
FlxG.fullscreen = !FlxG.fullscreen;
|
||||||
}
|
}
|
||||||
|
|
||||||
var pressedEnter:Bool = FlxG.keys.justPressed.ENTER;
|
var pressedEnter:Bool = FlxG.keys.justPressed.ENTER;
|
||||||
|
|
||||||
#if mobile
|
#if mobile
|
||||||
for (touch in FlxG.touches.list)
|
for (touch in FlxG.touches.list)
|
||||||
{
|
{
|
||||||
if (touch.justPressed)
|
if (touch.justPressed)
|
||||||
{
|
{
|
||||||
pressedEnter = true;
|
pressedEnter = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#end
|
#end
|
||||||
|
|
||||||
var gamepad:FlxGamepad = FlxG.gamepads.lastActive;
|
var gamepad:FlxGamepad = FlxG.gamepads.lastActive;
|
||||||
|
|
||||||
if (gamepad != null)
|
if (gamepad != null)
|
||||||
{
|
{
|
||||||
if (gamepad.justPressed.START)
|
if (gamepad.justPressed.START)
|
||||||
pressedEnter = true;
|
pressedEnter = true;
|
||||||
|
|
||||||
#if switch
|
#if switch
|
||||||
if (gamepad.justPressed.B)
|
if (gamepad.justPressed.B)
|
||||||
pressedEnter = true;
|
pressedEnter = true;
|
||||||
#end
|
#end
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pressedEnter && !transitioning && skippedIntro)
|
if (pressedEnter && !transitioning && skippedIntro)
|
||||||
{
|
{
|
||||||
#if !switch
|
#if !switch
|
||||||
NGio.unlockMedal(60960);
|
NGio.unlockMedal(60960);
|
||||||
|
|
||||||
// If it's Friday according to da clock
|
// If it's Friday according to da clock
|
||||||
if (Date.now().getDay() == 5)
|
if (Date.now().getDay() == 5)
|
||||||
NGio.unlockMedal(61034);
|
NGio.unlockMedal(61034);
|
||||||
#end
|
#end
|
||||||
|
|
||||||
if (FlxG.save.data.flashing)
|
if (FlxG.save.data.flashing)
|
||||||
titleText.animation.play('press');
|
titleText.animation.play('press');
|
||||||
|
|
||||||
FlxG.camera.flash(FlxColor.WHITE, 1);
|
FlxG.camera.flash(FlxColor.WHITE, 1);
|
||||||
FlxG.sound.play(Paths.sound('confirmMenu'), 0.7);
|
FlxG.sound.play(Paths.sound('confirmMenu'), 0.7);
|
||||||
|
|
||||||
transitioning = true;
|
transitioning = true;
|
||||||
// FlxG.sound.music.stop();
|
// FlxG.sound.music.stop();
|
||||||
|
|
||||||
new FlxTimer().start(2, function(tmr:FlxTimer)
|
new FlxTimer().start(2, function(tmr:FlxTimer)
|
||||||
{
|
{
|
||||||
|
// Get current version of Kade Engine
|
||||||
// Get current version of Kade Engine
|
|
||||||
|
//var http = new haxe.Http("https://raw.githubusercontent.com/KadeDev/Kade-Engine/master/version.downloadMe");
|
||||||
var http = new haxe.Http("https://raw.githubusercontent.com/KadeDev/Kade-Engine/master/version.downloadMe");
|
var http = new haxe.Http("https://raw.githubusercontent.com/theDetourist/Kade-Engine/patchnotes/version.downloadMe");
|
||||||
|
var returnedData:Array<String> = [];
|
||||||
http.onData = function (data:String) {
|
|
||||||
|
http.onData = function (data:String)
|
||||||
if (!MainMenuState.kadeEngineVer.contains(data.trim()) && !OutdatedSubState.leftState && MainMenuState.nightly == "")
|
{
|
||||||
{
|
returnedData[0] = data.substring(0, data.indexOf(';'));
|
||||||
trace('outdated lmao! ' + data.trim() + ' != ' + MainMenuState.kadeEngineVer);
|
returnedData[1] = data.substring(data.indexOf('-'), data.length);
|
||||||
OutdatedSubState.needVer = data;
|
if (!MainMenuState.kadeEngineVer.contains(returnedData[0].trim()) && !OutdatedSubState.leftState && MainMenuState.nightly == "")
|
||||||
FlxG.switchState(new OutdatedSubState());
|
{
|
||||||
}
|
trace('outdated lmao! ' + returnedData[0] + ' != ' + MainMenuState.kadeEngineVer);
|
||||||
else
|
OutdatedSubState.needVer = returnedData[0];
|
||||||
{
|
OutdatedSubState.currChanges = returnedData[1];
|
||||||
FlxG.switchState(new MainMenuState());
|
FlxG.switchState(new OutdatedSubState());
|
||||||
}
|
}
|
||||||
}
|
else
|
||||||
|
{
|
||||||
http.onError = function (error) {
|
FlxG.switchState(new MainMenuState());
|
||||||
trace('error: $error');
|
}
|
||||||
FlxG.switchState(new MainMenuState()); // fail but we go anyway
|
}
|
||||||
}
|
|
||||||
|
http.onError = function (error) {
|
||||||
http.request();
|
trace('error: $error');
|
||||||
|
FlxG.switchState(new MainMenuState()); // fail but we go anyway
|
||||||
});
|
}
|
||||||
// FlxG.sound.play(Paths.music('titleShoot'), 0.7);
|
|
||||||
}
|
http.request();
|
||||||
|
});
|
||||||
if (pressedEnter && !skippedIntro && initialized)
|
// FlxG.sound.play(Paths.music('titleShoot'), 0.7);
|
||||||
{
|
}
|
||||||
skipIntro();
|
|
||||||
}
|
if (pressedEnter && !skippedIntro && initialized)
|
||||||
|
{
|
||||||
super.update(elapsed);
|
skipIntro();
|
||||||
}
|
}
|
||||||
|
|
||||||
function createCoolText(textArray:Array<String>)
|
super.update(elapsed);
|
||||||
{
|
}
|
||||||
for (i in 0...textArray.length)
|
|
||||||
{
|
function createCoolText(textArray:Array<String>)
|
||||||
var money:Alphabet = new Alphabet(0, 0, textArray[i], true, false);
|
{
|
||||||
money.screenCenter(X);
|
for (i in 0...textArray.length)
|
||||||
money.y += (i * 60) + 200;
|
{
|
||||||
credGroup.add(money);
|
var money:Alphabet = new Alphabet(0, 0, textArray[i], true, false);
|
||||||
textGroup.add(money);
|
money.screenCenter(X);
|
||||||
}
|
money.y += (i * 60) + 200;
|
||||||
}
|
credGroup.add(money);
|
||||||
|
textGroup.add(money);
|
||||||
function addMoreText(text:String)
|
}
|
||||||
{
|
}
|
||||||
var coolText:Alphabet = new Alphabet(0, 0, text, true, false);
|
|
||||||
coolText.screenCenter(X);
|
function addMoreText(text:String)
|
||||||
coolText.y += (textGroup.length * 60) + 200;
|
{
|
||||||
credGroup.add(coolText);
|
var coolText:Alphabet = new Alphabet(0, 0, text, true, false);
|
||||||
textGroup.add(coolText);
|
coolText.screenCenter(X);
|
||||||
}
|
coolText.y += (textGroup.length * 60) + 200;
|
||||||
|
credGroup.add(coolText);
|
||||||
function deleteCoolText()
|
textGroup.add(coolText);
|
||||||
{
|
}
|
||||||
while (textGroup.members.length > 0)
|
|
||||||
{
|
function deleteCoolText()
|
||||||
credGroup.remove(textGroup.members[0], true);
|
{
|
||||||
textGroup.remove(textGroup.members[0], true);
|
while (textGroup.members.length > 0)
|
||||||
}
|
{
|
||||||
}
|
credGroup.remove(textGroup.members[0], true);
|
||||||
|
textGroup.remove(textGroup.members[0], true);
|
||||||
override function beatHit()
|
}
|
||||||
{
|
}
|
||||||
super.beatHit();
|
|
||||||
|
override function beatHit()
|
||||||
logoBl.animation.play('bump');
|
{
|
||||||
danceLeft = !danceLeft;
|
super.beatHit();
|
||||||
|
|
||||||
if (danceLeft)
|
logoBl.animation.play('bump');
|
||||||
gfDance.animation.play('danceRight');
|
danceLeft = !danceLeft;
|
||||||
else
|
|
||||||
gfDance.animation.play('danceLeft');
|
if (danceLeft)
|
||||||
|
gfDance.animation.play('danceRight');
|
||||||
FlxG.log.add(curBeat);
|
else
|
||||||
|
gfDance.animation.play('danceLeft');
|
||||||
switch (curBeat)
|
|
||||||
{
|
FlxG.log.add(curBeat);
|
||||||
case 1:
|
|
||||||
createCoolText(['ninjamuffin99', 'phantomArcade', 'kawaisprite', 'evilsk8er']);
|
switch (curBeat)
|
||||||
// credTextShit.visible = true;
|
{
|
||||||
case 3:
|
case 1:
|
||||||
addMoreText('present');
|
createCoolText(['ninjamuffin99', 'phantomArcade', 'kawaisprite', 'evilsk8er']);
|
||||||
// credTextShit.text += '\npresent...';
|
// credTextShit.visible = true;
|
||||||
// credTextShit.addText();
|
case 3:
|
||||||
case 4:
|
addMoreText('present');
|
||||||
deleteCoolText();
|
// credTextShit.text += '\npresent...';
|
||||||
// credTextShit.visible = false;
|
// credTextShit.addText();
|
||||||
// credTextShit.text = 'In association \nwith';
|
case 4:
|
||||||
// credTextShit.screenCenter();
|
deleteCoolText();
|
||||||
case 5:
|
// credTextShit.visible = false;
|
||||||
if (Main.watermarks)
|
// credTextShit.text = 'In association \nwith';
|
||||||
createCoolText(['Kade Engine', 'by']);
|
// credTextShit.screenCenter();
|
||||||
else
|
case 5:
|
||||||
createCoolText(['In Partnership', 'with']);
|
if (Main.watermarks)
|
||||||
case 7:
|
createCoolText(['Kade Engine', 'by']);
|
||||||
if (Main.watermarks)
|
else
|
||||||
addMoreText('KadeDeveloper');
|
createCoolText(['In Partnership', 'with']);
|
||||||
else
|
case 7:
|
||||||
{
|
if (Main.watermarks)
|
||||||
addMoreText('Newgrounds');
|
addMoreText('KadeDeveloper');
|
||||||
ngSpr.visible = true;
|
else
|
||||||
}
|
{
|
||||||
// credTextShit.text += '\nNewgrounds';
|
addMoreText('Newgrounds');
|
||||||
case 8:
|
ngSpr.visible = true;
|
||||||
deleteCoolText();
|
}
|
||||||
ngSpr.visible = false;
|
// credTextShit.text += '\nNewgrounds';
|
||||||
// credTextShit.visible = false;
|
case 8:
|
||||||
|
deleteCoolText();
|
||||||
// credTextShit.text = 'Shoutouts Tom Fulp';
|
ngSpr.visible = false;
|
||||||
// credTextShit.screenCenter();
|
// credTextShit.visible = false;
|
||||||
case 9:
|
|
||||||
createCoolText([curWacky[0]]);
|
// credTextShit.text = 'Shoutouts Tom Fulp';
|
||||||
// credTextShit.visible = true;
|
// credTextShit.screenCenter();
|
||||||
case 11:
|
case 9:
|
||||||
addMoreText(curWacky[1]);
|
createCoolText([curWacky[0]]);
|
||||||
// credTextShit.text += '\nlmao';
|
// credTextShit.visible = true;
|
||||||
case 12:
|
case 11:
|
||||||
deleteCoolText();
|
addMoreText(curWacky[1]);
|
||||||
// credTextShit.visible = false;
|
// credTextShit.text += '\nlmao';
|
||||||
// credTextShit.text = "Friday";
|
case 12:
|
||||||
// credTextShit.screenCenter();
|
deleteCoolText();
|
||||||
case 13:
|
// credTextShit.visible = false;
|
||||||
addMoreText('Friday');
|
// credTextShit.text = "Friday";
|
||||||
// credTextShit.visible = true;
|
// credTextShit.screenCenter();
|
||||||
case 14:
|
case 13:
|
||||||
addMoreText('Night');
|
addMoreText('Friday');
|
||||||
// credTextShit.text += '\nNight';
|
// credTextShit.visible = true;
|
||||||
case 15:
|
case 14:
|
||||||
addMoreText('Funkin'); // credTextShit.text += '\nFunkin';
|
addMoreText('Night');
|
||||||
|
// credTextShit.text += '\nNight';
|
||||||
case 16:
|
case 15:
|
||||||
skipIntro();
|
addMoreText('Funkin'); // credTextShit.text += '\nFunkin';
|
||||||
}
|
|
||||||
}
|
case 16:
|
||||||
|
skipIntro();
|
||||||
var skippedIntro:Bool = false;
|
}
|
||||||
|
}
|
||||||
function skipIntro():Void
|
|
||||||
{
|
var skippedIntro:Bool = false;
|
||||||
if (!skippedIntro)
|
|
||||||
{
|
function skipIntro():Void
|
||||||
remove(ngSpr);
|
{
|
||||||
|
if (!skippedIntro)
|
||||||
FlxG.camera.flash(FlxColor.WHITE, 4);
|
{
|
||||||
remove(credGroup);
|
remove(ngSpr);
|
||||||
skippedIntro = true;
|
|
||||||
}
|
FlxG.camera.flash(FlxColor.WHITE, 4);
|
||||||
}
|
remove(credGroup);
|
||||||
}
|
skippedIntro = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user