mirror of
https://github.com/FunkinCrew/Funkin.git
synced 2024-11-23 16:17:53 -05:00
commit
8e8b121663
8 changed files with 216 additions and 281 deletions
|
@ -23,9 +23,6 @@ class Conductor
|
|||
public static var lastSongPos:Float;
|
||||
public static var offset:Float = 0;
|
||||
|
||||
public static var safeFrames:Int = 10;
|
||||
public static var safeZoneOffset:Float = (safeFrames / 60) * 1000; // is calculated in create(), is safeFrames in milliseconds
|
||||
|
||||
public static var bpmChangeMap:Array<BPMChangeEvent> = [];
|
||||
|
||||
public function new()
|
||||
|
|
127
source/InitState.hx
Normal file
127
source/InitState.hx
Normal file
|
@ -0,0 +1,127 @@
|
|||
package;
|
||||
|
||||
import flixel.addons.transition.FlxTransitionSprite.GraphicTransTileDiamond;
|
||||
import flixel.addons.transition.FlxTransitionableState;
|
||||
import flixel.addons.transition.TransitionData;
|
||||
import flixel.graphics.FlxGraphic;
|
||||
import flixel.math.FlxPoint;
|
||||
import flixel.math.FlxRect;
|
||||
import flixel.util.FlxColor;
|
||||
import openfl.display.BitmapData;
|
||||
import ui.PreferencesMenu;
|
||||
import ui.stageBuildShit.StageBuilderState;
|
||||
|
||||
#if colyseus
|
||||
import io.colyseus.Client;
|
||||
import io.colyseus.Room;
|
||||
#end
|
||||
#if discord_rpc
|
||||
import Discord.DiscordClient;
|
||||
#end
|
||||
#if desktop
|
||||
import sys.FileSystem;
|
||||
import sys.io.File;
|
||||
import sys.thread.Thread;
|
||||
#end
|
||||
|
||||
using StringTools;
|
||||
|
||||
class InitState extends FlxTransitionableState
|
||||
{
|
||||
override public function create():Void
|
||||
{
|
||||
#if android
|
||||
FlxG.android.preventDefaultKeys = [FlxAndroidKey.BACK];
|
||||
#end
|
||||
#if newgrounds
|
||||
NGio.init();
|
||||
#end
|
||||
#if discord_rpc
|
||||
DiscordClient.initialize();
|
||||
|
||||
Application.current.onExit.add(function(exitCode){
|
||||
DiscordClient.shutdown();
|
||||
});
|
||||
#end
|
||||
|
||||
|
||||
// ==== flixel shit ==== //
|
||||
|
||||
FlxG.debugger.addButton(LEFT, new BitmapData(200, 200), function(){
|
||||
FlxG.debugger.visible = false;
|
||||
});
|
||||
|
||||
FlxG.sound.muteKeys = [ZERO];
|
||||
FlxG.game.focusLostFramerate = 60;
|
||||
|
||||
// FlxG.stage.window.borderless = true;
|
||||
// FlxG.stage.window.mouseLock = true;
|
||||
|
||||
var diamond:FlxGraphic = FlxGraphic.fromClass(GraphicTransTileDiamond);
|
||||
diamond.persist = true;
|
||||
diamond.destroyOnNoUse = false;
|
||||
|
||||
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));
|
||||
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));
|
||||
|
||||
// ===== save shit ===== //
|
||||
|
||||
FlxG.save.bind('funkin', 'ninjamuffin99');
|
||||
|
||||
// https://github.com/HaxeFlixel/flixel/pull/2396
|
||||
// IF/WHEN MY PR GOES THRU AND IT GETS INTO MAIN FLIXEL, DELETE THIS CHUNKOF CODE, AND THEN UNCOMMENT THE LINE BELOW
|
||||
// FlxG.sound.loadSavedPrefs();
|
||||
|
||||
if (FlxG.save.data.volume != null)
|
||||
FlxG.sound.volume = FlxG.save.data.volume;
|
||||
if (FlxG.save.data.mute != null)
|
||||
FlxG.sound.muted = FlxG.save.data.mute;
|
||||
|
||||
// FlxG.save.close();
|
||||
// FlxG.sound.loadSavedPrefs();
|
||||
PreferencesMenu.initPrefs();
|
||||
PlayerSettings.init();
|
||||
Highscore.load();
|
||||
|
||||
if (FlxG.save.data.weekUnlocked != null)
|
||||
{
|
||||
// FIX LATER!!!
|
||||
// WEEK UNLOCK PROGRESSION!!
|
||||
// StoryMenuState.weekUnlocked = FlxG.save.data.weekUnlocked;
|
||||
|
||||
if (StoryMenuState.weekUnlocked.length < 4)
|
||||
StoryMenuState.weekUnlocked.insert(0, true);
|
||||
|
||||
// QUICK PATCH OOPS!
|
||||
if (!StoryMenuState.weekUnlocked[0])
|
||||
StoryMenuState.weekUnlocked[0] = true;
|
||||
}
|
||||
|
||||
if (FlxG.save.data.seenVideo != null)
|
||||
VideoState.seenVideo = FlxG.save.data.seenVideo;
|
||||
|
||||
// ===== fuck outta here ===== //
|
||||
|
||||
// FlxTransitionableState.skipNextTransOut = true;
|
||||
FlxTransitionableState.skipNextTransIn = true;
|
||||
|
||||
#if FREEPLAY
|
||||
FlxG.switchState(new FreeplayState());
|
||||
#elseif ANIMATE
|
||||
FlxG.switchState(new animate.AnimTestStage());
|
||||
#elseif CHARTING
|
||||
FlxG.switchState(new ChartingState());
|
||||
#elseif STAGEBUILD
|
||||
FlxG.switchState(new StageBuilderState());
|
||||
#elseif ANIMDEBUG
|
||||
FlxG.switchState(new ui.animDebugShit.DebugBoundingState());
|
||||
#elseif NETTEST
|
||||
FlxG.switchState(new netTest.NetTest());
|
||||
#else
|
||||
FlxG.sound.cache(Paths.music('freakyMenu'));
|
||||
FlxG.switchState(new TitleState());
|
||||
#end
|
||||
}
|
||||
}
|
|
@ -19,7 +19,7 @@ class Main extends Sprite
|
|||
{
|
||||
var gameWidth:Int = 1280; // Width of the game in pixels (might be less / more in actual pixels depending on your zoom).
|
||||
var gameHeight:Int = 720; // Height of the game in pixels (might be less / more in actual pixels depending on your zoom).
|
||||
var initialState:Class<FlxState> = TitleState; // The FlxState the game starts with.
|
||||
var initialState:Class<FlxState> = InitState; // The FlxState the game starts with.
|
||||
var zoom:Float = -1; // If -1, zoom is automatically calculated to fit the window dimensions.
|
||||
#if web
|
||||
var framerate:Int = 60; // How many frames per second the game should run at.
|
||||
|
|
|
@ -34,7 +34,6 @@ class Note extends FlxSprite
|
|||
public var isSustainNote:Bool = false;
|
||||
|
||||
public var colorSwap:ColorSwap;
|
||||
public var noteScore:Float = 1;
|
||||
|
||||
public static var swagWidth:Float = 160 * 0.7;
|
||||
public static var PURP_NOTE:Int = 0;
|
||||
|
@ -42,6 +41,15 @@ class Note extends FlxSprite
|
|||
public static var BLUE_NOTE:Int = 1;
|
||||
public static var RED_NOTE:Int = 3;
|
||||
|
||||
// SCORING STUFF
|
||||
public static var safeFrames:Int = 10;
|
||||
public static var HIT_WINDOW:Float = (safeFrames / 60) * 1000; // 166.67 ms hit window
|
||||
// anything above bad threshold is shit
|
||||
public static var BAD_THRESHOLD:Float = 0.8; // 125ms , 8 frames
|
||||
public static var GOOD_THRESHOLD:Float = 0.55; // 91.67ms , 5.5 frames
|
||||
public static var SICK_THRESHOLD:Float = 0.2; // 33.33ms , 2 frames
|
||||
// anything below sick threshold is sick
|
||||
|
||||
public static var arrowColors:Array<Float> = [1, 1, 1, 1];
|
||||
|
||||
public function new(strumTime:Float, noteData:Int, ?prevNote:Note, ?sustainNote:Bool = false)
|
||||
|
@ -145,7 +153,6 @@ class Note extends FlxSprite
|
|||
|
||||
if (isSustainNote && prevNote != null)
|
||||
{
|
||||
noteScore * 0.2;
|
||||
alpha = 0.6;
|
||||
|
||||
if (PreferencesMenu.getPref('downscroll'))
|
||||
|
@ -224,9 +231,9 @@ class Note extends FlxSprite
|
|||
}
|
||||
else
|
||||
{
|
||||
if (strumTime > Conductor.songPosition - Conductor.safeZoneOffset)
|
||||
{ // The * 0.5 is so that it's easier to hit them too late, instead of too early
|
||||
if (strumTime < Conductor.songPosition + (Conductor.safeZoneOffset * 0.5))
|
||||
if (strumTime > Conductor.songPosition - HIT_WINDOW)
|
||||
{ // * 0.2 if sustain note, so u have to keep holding it closer to all the way thru!
|
||||
if (strumTime < Conductor.songPosition + (HIT_WINDOW * (isSustainNote ? 0.2 : 1)))
|
||||
canBeHit = true;
|
||||
}
|
||||
else
|
||||
|
|
|
@ -31,17 +31,12 @@ class NoteSplash extends FlxSprite
|
|||
alpha = 0.6;
|
||||
|
||||
animation.play('note' + noteData + '-' + FlxG.random.int(0, 1), true);
|
||||
animation.curAnim.frameRate += FlxG.random.int(-2, 2);
|
||||
animation.curAnim.frameRate = 24 + FlxG.random.int(-2, 2);
|
||||
animation.finishCallback = function(name){
|
||||
kill();
|
||||
};
|
||||
updateHitbox();
|
||||
|
||||
offset.set(width * 0.3, height * 0.3);
|
||||
}
|
||||
|
||||
override function update(elapsed:Float)
|
||||
{
|
||||
if (animation.curAnim.finished)
|
||||
kill();
|
||||
|
||||
super.update(elapsed);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,12 +25,12 @@ class Paths
|
|||
var levelPath = getLibraryPathForce(file, currentLevel);
|
||||
if (OpenFlAssets.exists(levelPath, type))
|
||||
return levelPath;
|
||||
|
||||
levelPath = getLibraryPathForce(file, "shared");
|
||||
if (OpenFlAssets.exists(levelPath, type))
|
||||
return levelPath;
|
||||
}
|
||||
|
||||
var levelPath = getLibraryPathForce(file, "shared");
|
||||
if (OpenFlAssets.exists(levelPath, type))
|
||||
return levelPath;
|
||||
|
||||
return getPreloadPath(file);
|
||||
}
|
||||
|
||||
|
|
|
@ -1770,7 +1770,7 @@ class PlayState extends MusicBeatState
|
|||
if (vocalsFinished)
|
||||
return;
|
||||
|
||||
vocals.time = Conductor.songPosition;
|
||||
vocals.time = FlxG.sound.music.time;
|
||||
vocals.play();
|
||||
}
|
||||
|
||||
|
@ -1780,9 +1780,6 @@ class PlayState extends MusicBeatState
|
|||
|
||||
override public function update(elapsed:Float)
|
||||
{
|
||||
// makes the lerp non-dependant on the framerate
|
||||
// FlxG.camera.followLerp = CoolUtil.camLerpShit(0.04);
|
||||
|
||||
#if !debug
|
||||
perfectMode = false;
|
||||
#else
|
||||
|
@ -1873,6 +1870,7 @@ class PlayState extends MusicBeatState
|
|||
paused = true;
|
||||
|
||||
// 1 / 1000 chance for Gitaroo Man easter egg
|
||||
// can this please move to dying it's kinda fucked up that pausing has a 1/1000 chance ur forced to restart
|
||||
if (FlxG.random.bool(0.1))
|
||||
{
|
||||
// gitaroo man easter egg
|
||||
|
@ -1904,9 +1902,6 @@ class PlayState extends MusicBeatState
|
|||
if (FlxG.keys.justPressed.NINE)
|
||||
iconP1.swapOldIcon();
|
||||
|
||||
// FlxG.watch.addQuick('VOL', vocals.amplitudeLeft);
|
||||
// FlxG.watch.addQuick('VOLRight', vocals.amplitudeRight);
|
||||
|
||||
iconP1.setGraphicSize(Std.int(CoolUtil.coolLerp(iconP1.width, 150, 0.15)));
|
||||
iconP2.setGraphicSize(Std.int(CoolUtil.coolLerp(iconP2.width, 150, 0.15)));
|
||||
|
||||
|
@ -1973,24 +1968,9 @@ class PlayState extends MusicBeatState
|
|||
gfSpeed = 2;
|
||||
case 112:
|
||||
gfSpeed = 1;
|
||||
case 163:
|
||||
// FlxG.sound.music.stop();
|
||||
// FlxG.switchState(new TitleState());
|
||||
}
|
||||
}
|
||||
|
||||
if (curSong == 'Bopeebo')
|
||||
{
|
||||
switch (curBeat)
|
||||
{
|
||||
case 128, 129, 130:
|
||||
vocals.volume = 0;
|
||||
// FlxG.sound.music.stop();
|
||||
// FlxG.switchState(new PlayState());
|
||||
}
|
||||
}
|
||||
// better streaming of shit
|
||||
|
||||
if (!inCutscene && !_exiting)
|
||||
{
|
||||
// RESET = Quick Game Over Screen
|
||||
|
@ -2223,6 +2203,7 @@ class PlayState extends MusicBeatState
|
|||
daPos += 4 * (1000 * 60 / daBPM);
|
||||
}
|
||||
Conductor.songPosition = FlxG.sound.music.time = daPos;
|
||||
Conductor.songPosition += Conductor.offset;
|
||||
updateCurStep();
|
||||
resyncVocals();
|
||||
}
|
||||
|
@ -2339,19 +2320,19 @@ class PlayState extends MusicBeatState
|
|||
|
||||
var isSick:Bool = true;
|
||||
|
||||
if (noteDiff > Conductor.safeZoneOffset * 0.9)
|
||||
if (noteDiff > Note.HIT_WINDOW * Note.BAD_THRESHOLD)
|
||||
{
|
||||
daRating = 'shit';
|
||||
score = 50;
|
||||
isSick = false; // shitty copypaste on this literally just because im lazy and tired lol!
|
||||
}
|
||||
else if (noteDiff > Conductor.safeZoneOffset * 0.75)
|
||||
else if (noteDiff > Note.HIT_WINDOW * Note.GOOD_THRESHOLD)
|
||||
{
|
||||
daRating = 'bad';
|
||||
score = 100;
|
||||
isSick = false;
|
||||
}
|
||||
else if (noteDiff > Conductor.safeZoneOffset * 0.2)
|
||||
else if (noteDiff > Note.HIT_WINDOW * Note.SICK_THRESHOLD)
|
||||
{
|
||||
daRating = 'good';
|
||||
score = 200;
|
||||
|
@ -2963,11 +2944,6 @@ class PlayState extends MusicBeatState
|
|||
{
|
||||
resyncVocals();
|
||||
}
|
||||
|
||||
if (dad.curCharacter == 'spooky' && curStep % 4 == 2)
|
||||
{
|
||||
// dad.dance();
|
||||
}
|
||||
}
|
||||
|
||||
var lightningStrikeBeat:Int = 0;
|
||||
|
|
|
@ -1,12 +1,8 @@
|
|||
package;
|
||||
|
||||
import flixel.FlxGame;
|
||||
import flixel.FlxObject;
|
||||
import flixel.FlxSprite;
|
||||
import flixel.addons.transition.FlxTransitionSprite.GraphicTransTileDiamond;
|
||||
import flixel.addons.transition.FlxTransitionableState;
|
||||
import flixel.addons.transition.TransitionData;
|
||||
import flixel.graphics.FlxGraphic;
|
||||
import flixel.FlxState;
|
||||
import flixel.group.FlxGroup;
|
||||
import flixel.input.android.FlxAndroidKey;
|
||||
import flixel.input.android.FlxAndroidKeys;
|
||||
|
@ -14,8 +10,6 @@ import flixel.input.gamepad.FlxGamepad;
|
|||
import flixel.input.gamepad.id.SwitchJoyconLeftID;
|
||||
import flixel.math.FlxPoint;
|
||||
import flixel.math.FlxRect;
|
||||
import flixel.system.FlxAssets.FlxGraphicAsset;
|
||||
import flixel.system.FlxAssets;
|
||||
import flixel.text.FlxText;
|
||||
import flixel.tweens.FlxEase;
|
||||
import flixel.tweens.FlxTween;
|
||||
|
@ -26,32 +20,21 @@ import lime.graphics.Image;
|
|||
import lime.media.AudioContext;
|
||||
import lime.ui.Window;
|
||||
import openfl.Assets;
|
||||
import openfl.display.BitmapData;
|
||||
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.BuildingShaders.BuildingShader;
|
||||
import shaderslmfao.BuildingShaders;
|
||||
import shaderslmfao.ColorSwap;
|
||||
import shaderslmfao.TitleOutline;
|
||||
import ui.PreferencesMenu;
|
||||
import ui.stageBuildShit.StageBuilderState;
|
||||
|
||||
using StringTools;
|
||||
|
||||
#if colyseus
|
||||
import io.colyseus.Client;
|
||||
import io.colyseus.Room;
|
||||
#end
|
||||
#if discord_rpc
|
||||
import Discord.DiscordClient;
|
||||
#end
|
||||
#if desktop
|
||||
import sys.FileSystem;
|
||||
import sys.io.File;
|
||||
|
@ -62,20 +45,15 @@ class TitleState extends MusicBeatState
|
|||
{
|
||||
public static var initialized:Bool = false;
|
||||
|
||||
var startedIntro:Bool;
|
||||
|
||||
var blackScreen:FlxSprite;
|
||||
var credGroup:FlxGroup;
|
||||
var credTextShit:Alphabet;
|
||||
var textGroup:FlxGroup;
|
||||
var ngSpr:FlxSprite;
|
||||
|
||||
var curWacky:Array<String> = [];
|
||||
var wackyImage:FlxSprite;
|
||||
var lastBeat:Int = 0;
|
||||
var swagShader:ColorSwap;
|
||||
var alphaShader:BuildingShaders;
|
||||
var thingie:FlxSprite;
|
||||
|
||||
var video:Video;
|
||||
var netStream:NetStream;
|
||||
|
@ -83,24 +61,9 @@ class TitleState extends MusicBeatState
|
|||
|
||||
override public function create():Void
|
||||
{
|
||||
#if android
|
||||
FlxG.android.preventDefaultKeys = [FlxAndroidKey.BACK];
|
||||
#end
|
||||
|
||||
FlxG.debugger.addButton(LEFT, new BitmapData(200, 200), function()
|
||||
{
|
||||
FlxG.debugger.visible = false;
|
||||
});
|
||||
|
||||
startedIntro = false;
|
||||
|
||||
FlxG.game.focusLostFramerate = 60;
|
||||
|
||||
swagShader = new ColorSwap();
|
||||
alphaShader = new BuildingShaders();
|
||||
|
||||
FlxG.sound.muteKeys = [ZERO];
|
||||
|
||||
curWacky = FlxG.random.getObject(getIntroTextShit());
|
||||
FlxG.sound.cache(Paths.music('freakyMenu'));
|
||||
|
||||
|
@ -108,57 +71,6 @@ class TitleState extends MusicBeatState
|
|||
|
||||
super.create();
|
||||
|
||||
FlxG.save.bind('funkin', 'ninjamuffin99');
|
||||
|
||||
// https://github.com/HaxeFlixel/flixel/pull/2396
|
||||
// IF/WHEN MY PR GOES THRU AND IT GETS INTO MAIN FLIXEL, DELETE THIS CHUNKOF CODE, AND THEN UNCOMMENT THE LINE BELOW
|
||||
// FlxG.sound.loadSavedPrefs();
|
||||
|
||||
if (FlxG.save.data.volume != null)
|
||||
{
|
||||
FlxG.sound.volume = FlxG.save.data.volume;
|
||||
}
|
||||
|
||||
if (FlxG.save.data.mute != null)
|
||||
{
|
||||
FlxG.sound.muted = FlxG.save.data.mute;
|
||||
}
|
||||
|
||||
// FlxG.save.close();
|
||||
// FlxG.sound.loadSavedPrefs();
|
||||
PreferencesMenu.initPrefs();
|
||||
PlayerSettings.init();
|
||||
Highscore.load();
|
||||
|
||||
#if newgrounds
|
||||
NGio.init();
|
||||
#end
|
||||
|
||||
if (FlxG.save.data.weekUnlocked != null)
|
||||
{
|
||||
// FIX LATER!!!
|
||||
// WEEK UNLOCK PROGRESSION!!
|
||||
// StoryMenuState.weekUnlocked = FlxG.save.data.weekUnlocked;
|
||||
|
||||
if (StoryMenuState.weekUnlocked.length < 4)
|
||||
StoryMenuState.weekUnlocked.insert(0, true);
|
||||
|
||||
// QUICK PATCH OOPS!
|
||||
if (!StoryMenuState.weekUnlocked[0])
|
||||
StoryMenuState.weekUnlocked[0] = true;
|
||||
}
|
||||
|
||||
if (FlxG.save.data.seenVideo != null)
|
||||
{
|
||||
VideoState.seenVideo = FlxG.save.data.seenVideo;
|
||||
}
|
||||
|
||||
#if FREEPLAY
|
||||
FlxG.switchState(new FreeplayState());
|
||||
#elseif ANIMATE
|
||||
FlxG.switchState(new animate.AnimTestStage());
|
||||
#elseif CHARTING
|
||||
FlxG.switchState(new ChartingState());
|
||||
/*
|
||||
#elseif web
|
||||
|
||||
|
@ -190,30 +102,10 @@ class TitleState extends MusicBeatState
|
|||
*/
|
||||
|
||||
// netConnection.addEventListener(MouseEvent.MOUSE_DOWN, overlay_onMouseDown);
|
||||
#elseif STAGEBUILD
|
||||
FlxG.switchState(new StageBuilderState());
|
||||
#elseif ANIMDEBUG
|
||||
FlxG.switchState(new ui.animDebugShit.DebugBoundingState());
|
||||
#elseif NETTEST
|
||||
FlxG.switchState(new netTest.NetTest());
|
||||
#else
|
||||
new FlxTimer().start(1, function(tmr:FlxTimer)
|
||||
{
|
||||
startIntro();
|
||||
});
|
||||
#end
|
||||
|
||||
#if discord_rpc
|
||||
DiscordClient.initialize();
|
||||
|
||||
Application.current.onExit.add(function(exitCode)
|
||||
{
|
||||
DiscordClient.shutdown();
|
||||
});
|
||||
#end
|
||||
|
||||
// FlxG.stage.window.borderless = true;
|
||||
// FlxG.stage.window.mouseLock = true;
|
||||
}
|
||||
|
||||
private function client_onMetaData(metaData:Dynamic)
|
||||
|
@ -261,18 +153,6 @@ class TitleState extends MusicBeatState
|
|||
|
||||
function startIntro()
|
||||
{
|
||||
if (!initialized)
|
||||
{
|
||||
var diamond:FlxGraphic = FlxGraphic.fromClass(GraphicTransTileDiamond);
|
||||
diamond.persist = true;
|
||||
diamond.destroyOnNoUse = false;
|
||||
|
||||
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));
|
||||
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));
|
||||
}
|
||||
|
||||
if (FlxG.sound.music == null || !FlxG.sound.music.playing)
|
||||
{
|
||||
FlxG.sound.playMusic(Paths.music('freakyMenu'), 0);
|
||||
|
@ -283,10 +163,6 @@ class TitleState extends MusicBeatState
|
|||
persistentUpdate = true;
|
||||
|
||||
var bg:FlxSprite = new FlxSprite().makeGraphic(FlxG.width, FlxG.height, FlxColor.BLACK);
|
||||
// bg.antialiasing = true;
|
||||
// bg.setGraphicSize(Std.int(bg.width * 0.6));
|
||||
// bg.updateHitbox();
|
||||
|
||||
add(bg);
|
||||
|
||||
logoBl = new FlxSprite(-150, -100);
|
||||
|
@ -334,34 +210,18 @@ class TitleState extends MusicBeatState
|
|||
// titleText.screenCenter(X);
|
||||
add(titleText);
|
||||
|
||||
var logo:FlxSprite = new FlxSprite().loadGraphic(Paths.image('logo'));
|
||||
logo.screenCenter();
|
||||
logo.antialiasing = true;
|
||||
// add(logo);
|
||||
|
||||
// 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});
|
||||
var animShit:ComboCounter = new ComboCounter(200, 200, 1423);
|
||||
// add(animShit);
|
||||
credGroup = new FlxGroup();
|
||||
add(credGroup);
|
||||
|
||||
textGroup = new FlxGroup();
|
||||
|
||||
blackScreen = new FlxSprite().makeGraphic(FlxG.width, FlxG.height, FlxColor.BLACK);
|
||||
blackScreen = bg.clone();
|
||||
credGroup.add(blackScreen);
|
||||
|
||||
// var atlasBullShit:FlxSprite = new FlxSprite();
|
||||
// atlasBullShit.frames = CoolUtil.fromAnimate(Paths.image('money'), Paths.file('images/money.json'));
|
||||
// credGroup.add(atlasBullShit);
|
||||
|
||||
credTextShit = new Alphabet(0, 0, "ninjamuffin99\nPhantomArcade\nkawaisprite\nevilsk8er", true);
|
||||
credTextShit.screenCenter();
|
||||
|
||||
// credTextShit.alignment = CENTER;
|
||||
|
||||
credTextShit.visible = false;
|
||||
|
||||
ngSpr = new FlxSprite(0, FlxG.height * 0.52);
|
||||
|
||||
if (FlxG.random.bool(1))
|
||||
|
@ -388,8 +248,6 @@ class TitleState extends MusicBeatState
|
|||
ngSpr.screenCenter(X);
|
||||
ngSpr.antialiasing = true;
|
||||
|
||||
FlxTween.tween(credTextShit, {y: credTextShit.y + 20}, 2.9, {ease: FlxEase.quadInOut, type: PINGPONG});
|
||||
|
||||
FlxG.mouse.visible = false;
|
||||
|
||||
if (initialized)
|
||||
|
@ -399,9 +257,6 @@ class TitleState extends MusicBeatState
|
|||
|
||||
if (FlxG.sound.music != null)
|
||||
FlxG.sound.music.onComplete = function() FlxG.switchState(new VideoState());
|
||||
|
||||
startedIntro = true;
|
||||
// credGroup.add(credTextShit);
|
||||
}
|
||||
|
||||
function getIntroTextShit():Array<Array<String>>
|
||||
|
@ -421,9 +276,6 @@ class TitleState extends MusicBeatState
|
|||
|
||||
var transitioning:Bool = false;
|
||||
|
||||
var fnfShit:String = "Friday Night Funkin'";
|
||||
var thingOffset:Int = 0;
|
||||
|
||||
override function update(elapsed:Float)
|
||||
{
|
||||
/* if (FlxG.onMobile)
|
||||
|
@ -501,9 +353,10 @@ class TitleState extends MusicBeatState
|
|||
|
||||
if (FlxG.sound.music != null)
|
||||
Conductor.songPosition = FlxG.sound.music.time;
|
||||
// FlxG.watch.addQuick('amp', FlxG.sound.music.amplitude);
|
||||
if (FlxG.keys.justPressed.F)
|
||||
FlxG.fullscreen = !FlxG.fullscreen;
|
||||
|
||||
// do controls.PAUSE | controls.ACCEPT instead?
|
||||
var pressedEnter:Bool = FlxG.keys.justPressed.ENTER;
|
||||
|
||||
if (FlxG.onMobile)
|
||||
|
@ -542,13 +395,8 @@ class TitleState extends MusicBeatState
|
|||
FlxG.camera.flash(FlxColor.WHITE, 1);
|
||||
FlxG.sound.play(Paths.sound('confirmMenu'), 0.7);
|
||||
transitioning = true;
|
||||
// FlxG.sound.music.stop();
|
||||
|
||||
// These assets are very unlikely to be used for the rest of gameplay, so it unloads them from cache/memory
|
||||
// Saves about 50mb of RAM or so???
|
||||
Assets.cache.clear(Paths.image('gfDanceTitle'));
|
||||
Assets.cache.clear(Paths.image('logoBumpin'));
|
||||
Assets.cache.clear(Paths.image('titleEnter'));
|
||||
var targetState:FlxState = new MainMenuState();
|
||||
|
||||
#if newgrounds
|
||||
if (!OutdatedSubState.leftState)
|
||||
|
@ -561,19 +409,26 @@ class TitleState extends MusicBeatState
|
|||
if (version.trim() != onlineVersion)
|
||||
{
|
||||
trace('OLD VERSION!');
|
||||
// FlxG.switchState(new OutdatedSubState());
|
||||
// targetState = new OutdatedSubState();
|
||||
}
|
||||
else
|
||||
{
|
||||
// FlxG.switchState(new MainMenuState());
|
||||
// targetState = new MainMenuState();
|
||||
}
|
||||
// REDO FOR ITCH/FINAL SHIT
|
||||
FlxG.switchState(new MainMenuState());
|
||||
});
|
||||
}
|
||||
#else
|
||||
FlxG.switchState(new MainMenuState());
|
||||
#end
|
||||
new FlxTimer().start(2, function(tmr:FlxTimer)
|
||||
{
|
||||
// These assets are very unlikely to be used for the rest of gameplay, so it unloads them from cache/memory
|
||||
// Saves about 50mb of RAM or so???
|
||||
Assets.cache.clear(Paths.image('gfDanceTitle'));
|
||||
Assets.cache.clear(Paths.image('logoBumpin'));
|
||||
Assets.cache.clear(Paths.image('titleEnter'));
|
||||
// ngSpr??
|
||||
FlxG.switchState(targetState);
|
||||
});
|
||||
// FlxG.sound.play(Paths.music('titleShoot'), 0.7);
|
||||
}
|
||||
if (pressedEnter && !skippedIntro && initialized)
|
||||
|
@ -591,8 +446,6 @@ class TitleState extends MusicBeatState
|
|||
#end
|
||||
*/
|
||||
|
||||
// if (FlxG.keys.justPressed.SPACE)
|
||||
// swagShader.hasOutline = !swagShader.hasOutline;
|
||||
if (controls.UI_LEFT)
|
||||
swagShader.update(-elapsed * 0.1);
|
||||
if (controls.UI_RIGHT)
|
||||
|
@ -678,11 +531,56 @@ class TitleState extends MusicBeatState
|
|||
}
|
||||
|
||||
var isRainbow:Bool = false;
|
||||
var skippedIntro:Bool = false;
|
||||
|
||||
override function beatHit()
|
||||
{
|
||||
super.beatHit();
|
||||
|
||||
if (!skippedIntro)
|
||||
{
|
||||
FlxG.log.add(curBeat);
|
||||
// if the user is draggin the window some beats will
|
||||
// be missed so this is just to compensate
|
||||
if (curBeat > lastBeat)
|
||||
{
|
||||
for (i in lastBeat...curBeat)
|
||||
{
|
||||
switch (i + 1)
|
||||
{
|
||||
case 1:
|
||||
createCoolText(['ninjamuffin99', 'phantomArcade', 'kawaisprite', 'evilsk8er']);
|
||||
case 3:
|
||||
addMoreText('present');
|
||||
case 4:
|
||||
deleteCoolText();
|
||||
case 5:
|
||||
createCoolText(['In association', 'with']);
|
||||
case 7:
|
||||
addMoreText('newgrounds');
|
||||
ngSpr.visible = true;
|
||||
case 8:
|
||||
deleteCoolText();
|
||||
ngSpr.visible = false;
|
||||
case 9:
|
||||
createCoolText([curWacky[0]]);
|
||||
case 11:
|
||||
addMoreText(curWacky[1]);
|
||||
case 12:
|
||||
deleteCoolText();
|
||||
case 13:
|
||||
addMoreText('Friday');
|
||||
case 14:
|
||||
addMoreText('Night');
|
||||
case 15:
|
||||
addMoreText('Funkin');
|
||||
case 16:
|
||||
skipIntro();
|
||||
}
|
||||
}
|
||||
}
|
||||
lastBeat = curBeat;
|
||||
}
|
||||
if (skippedIntro)
|
||||
{
|
||||
if (cheatActive && curBeat % 2 == 0)
|
||||
|
@ -697,73 +595,8 @@ class TitleState extends MusicBeatState
|
|||
else
|
||||
gfDance.animation.play('danceLeft');
|
||||
}
|
||||
else
|
||||
{
|
||||
FlxG.log.add(curBeat);
|
||||
// if the user is draggin the window some beats will
|
||||
// be missed so this is just to compensate
|
||||
if (curBeat > lastBeat)
|
||||
{
|
||||
for (i in lastBeat...curBeat)
|
||||
{
|
||||
switch (i + 1)
|
||||
{
|
||||
case 1:
|
||||
createCoolText(['ninjamuffin99', 'phantomArcade', 'kawaisprite', 'evilsk8er']);
|
||||
// credTextShit.visible = true;
|
||||
case 3:
|
||||
addMoreText('present');
|
||||
// credTextShit.text += '\npresent...';
|
||||
// credTextShit.addText();
|
||||
case 4:
|
||||
deleteCoolText();
|
||||
// credTextShit.visible = false;
|
||||
// credTextShit.text = 'In association \nwith';
|
||||
// credTextShit.screenCenter();
|
||||
case 5:
|
||||
createCoolText(['In association', 'with']);
|
||||
case 7:
|
||||
addMoreText('newgrounds');
|
||||
ngSpr.visible = true;
|
||||
// credTextShit.text += '\nNewgrounds';
|
||||
case 8:
|
||||
deleteCoolText();
|
||||
ngSpr.visible = false;
|
||||
// credTextShit.visible = false;
|
||||
|
||||
// credTextShit.text = 'Shoutouts Tom Fulp';
|
||||
// credTextShit.screenCenter();
|
||||
case 9:
|
||||
createCoolText([curWacky[0]]);
|
||||
// credTextShit.visible = true;
|
||||
case 11:
|
||||
addMoreText(curWacky[1]);
|
||||
// credTextShit.text += '\nlmao';
|
||||
case 12:
|
||||
deleteCoolText();
|
||||
// credTextShit.visible = false;
|
||||
// credTextShit.text = "Friday";
|
||||
// credTextShit.screenCenter();
|
||||
case 13:
|
||||
addMoreText('Friday');
|
||||
// credTextShit.visible = true;
|
||||
case 14:
|
||||
addMoreText('Night');
|
||||
// credTextShit.text += '\nNight';
|
||||
case 15:
|
||||
addMoreText('Funkin'); // credTextShit.text += '\nFunkin';
|
||||
|
||||
case 16:
|
||||
skipIntro();
|
||||
}
|
||||
}
|
||||
}
|
||||
lastBeat = curBeat;
|
||||
}
|
||||
}
|
||||
|
||||
var skippedIntro:Bool = false;
|
||||
|
||||
function skipIntro():Void
|
||||
{
|
||||
if (!skippedIntro)
|
||||
|
|
Loading…
Reference in a new issue