diff --git a/Project.xml b/Project.xml
index d39a059c..f00fe471 100644
--- a/Project.xml
+++ b/Project.xml
@@ -52,16 +52,11 @@
-
@@ -128,12 +123,11 @@
-
-
-
+
+
-
+
diff --git a/art/build_html-debug.bat b/art/Building/build_html-debug.bat
similarity index 100%
rename from art/build_html-debug.bat
rename to art/Building/build_html-debug.bat
diff --git a/art/build_html.bat b/art/Building/build_html.bat
similarity index 100%
rename from art/build_html.bat
rename to art/Building/build_html.bat
diff --git a/art/build_x32.bat b/art/Building/build_x32.bat
similarity index 100%
rename from art/build_x32.bat
rename to art/Building/build_x32.bat
diff --git a/art/build_x64-debug.bat b/art/Building/build_x64-debug.bat
similarity index 100%
rename from art/build_x64-debug.bat
rename to art/Building/build_x64-debug.bat
diff --git a/art/build_x64.bat b/art/Building/build_x64.bat
similarity index 100%
rename from art/build_x64.bat
rename to art/Building/build_x64.bat
diff --git a/art/psyshit/500.png b/art/astroshit/psyshit/500.png
similarity index 100%
rename from art/psyshit/500.png
rename to art/astroshit/psyshit/500.png
diff --git a/art/psyshit/500xOG.png b/art/astroshit/psyshit/500xOG.png
similarity index 100%
rename from art/psyshit/500xOG.png
rename to art/astroshit/psyshit/500xOG.png
diff --git a/art/psyshit/512-modified.png b/art/astroshit/psyshit/512-modified.png
similarity index 100%
rename from art/psyshit/512-modified.png
rename to art/astroshit/psyshit/512-modified.png
diff --git a/art/psyshit/512.png b/art/astroshit/psyshit/512.png
similarity index 100%
rename from art/psyshit/512.png
rename to art/astroshit/psyshit/512.png
diff --git a/assets/preload/images/alphabetOld.png b/assets/preload/images/alphabetOld.png
deleted file mode 100644
index 419a6124..00000000
Binary files a/assets/preload/images/alphabetOld.png and /dev/null differ
diff --git a/assets/preload/images/alphabetOld.xml b/assets/preload/images/alphabetOld.xml
deleted file mode 100644
index 856c66b5..00000000
--- a/assets/preload/images/alphabetOld.xml
+++ /dev/null
@@ -1,601 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/hmm.json b/hmm.json
index 493d7c64..1afc1ed7 100644
--- a/hmm.json
+++ b/hmm.json
@@ -8,12 +8,12 @@
{
"name": "openfl",
"type": "haxelib",
- "version": "9.3.2"
+ "version": null
},
{
"name": "flixel",
"type": "haxelib",
- "version": "5.5.0"
+ "version": null
},
{
"name": "flixel-addons",
diff --git a/source/game/options/BaseOptionsMenu.hx b/source/game/options/BaseOptionsMenu.hx
index 73201eda..7ed9b8fb 100644
--- a/source/game/options/BaseOptionsMenu.hx
+++ b/source/game/options/BaseOptionsMenu.hx
@@ -30,6 +30,7 @@ import backend.system.MusicBeatSubstate;
import backend.system.MusicBeatState;
import game.objects.AttachedText;
import game.objects.*;
+import game.options.objects.CheckboxThingie;
using StringTools;
diff --git a/source/game/options/CheckboxThingie.hx b/source/game/options/objects/CheckboxThingie.hx
similarity index 98%
rename from source/game/options/CheckboxThingie.hx
rename to source/game/options/objects/CheckboxThingie.hx
index c2d99c70..1cb31a4a 100644
--- a/source/game/options/CheckboxThingie.hx
+++ b/source/game/options/objects/CheckboxThingie.hx
@@ -1,4 +1,4 @@
-package game.options;
+package game.options.objects;
import flixel.FlxSprite;
import flixel.graphics.frames.FlxAtlasFrames;
diff --git a/source/game/states/AnimatedImageState.hx b/source/game/states/AnimatedImageState.hx
index 547598ae..5ddfec3e 100644
--- a/source/game/states/AnimatedImageState.hx
+++ b/source/game/states/AnimatedImageState.hx
@@ -6,9 +6,9 @@ import flixel.FlxG;
import flixel.text.FlxText;
import flixel.FlxSprite;
import flixel.util.FlxColor;
-
import backend.system.MusicBeatSubstate;
import backend.system.MusicBeatState;
+
using StringTools;
class AnimatedImageState extends MusicBeatState
@@ -18,8 +18,8 @@ class AnimatedImageState extends MusicBeatState
var index:FlxSprite;
var stateReturn:FlxState;
-
- public function new(text:String, image:String, animPrefix:String, center:Bool, framerate:Int = 24, returnState:FlxState, color:FlxColor = FlxColorPastel.PASTELPINK)
+ public function new(text:String, image:String, animPrefix:String, center:Bool, framerate:Int = 24, returnState:FlxState,
+ color:FlxColor = FlxColorPastel.PASTELPINK)
{
super();
FlxG.sound.music.stop();
@@ -41,11 +41,12 @@ class AnimatedImageState extends MusicBeatState
index.frames = backend.utils.Paths.getSparrowAtlas(image);
index.antialiasing = backend.utils.ClientPrefs.data.globalAntialiasing;
index.animation.addByPrefix('instance', animPrefix, framerate, true);
- if (center) index.screenCenter();
+ if (center)
+ index.screenCenter();
index.animation.play('instance');
index.updateHitbox();
add(index);
- };
+ }
override function update(elapsed:Float)
{
diff --git a/source/game/states/OutdatedState.hx b/source/game/states/OutdatedState.hx
index 5b226acc..81ac19d2 100644
--- a/source/game/states/OutdatedState.hx
+++ b/source/game/states/OutdatedState.hx
@@ -1,5 +1,6 @@
package game.states;
+import backend.data.EngineData;
import backend.CoolUtil;
import flixel.FlxG;
import flixel.FlxSprite;
@@ -12,14 +13,15 @@ import flixel.addons.transition.FlxTransitionableState;
import flixel.tweens.FlxTween;
import flixel.util.FlxTimer;
import backend.data.PsychData;
-
import backend.system.MusicBeatSubstate;
import backend.system.MusicBeatState;
+
class OutdatedState extends MusicBeatState
{
public static var leftState:Bool = false;
var warnText:FlxText;
+
override function create()
{
super.create();
@@ -27,14 +29,16 @@ class OutdatedState extends MusicBeatState
var bg:FlxSprite = new FlxSprite().makeGraphic(FlxG.width, FlxG.height, FlxColor.BLACK);
add(bg);
- warnText = new FlxText(0, 0, FlxG.width,
- "Sup bro, looks like you're running an \n
- outdated version of Psych Engine (" + PsychData.psychVersion + "),\n
- please update to " + game.states.TitleState.updateVersion + "!\n
+ warnText = new FlxText(0, 0, FlxG.width, "Sup bro, looks like you're running an \n
+ outdated version of Astro Engine ["
+ + EngineData.mainCoreShit.coreVersion
+ + "],\n
+ please update to "
+ + game.states.TitleState.updateVersion
+ + "!\n
Press ESCAPE to proceed anyway.\n
\n
- Thank you for using the Engine!",
- 32);
+ Thank you for using the Engine!", 32);
warnText.setFormat("VCR OSD Mono", 32, FlxColor.WHITE, CENTER);
warnText.screenCenter(Y);
add(warnText);
@@ -42,20 +46,24 @@ class OutdatedState extends MusicBeatState
override function update(elapsed:Float)
{
- if(!leftState) {
- if (controls.ACCEPT) {
+ if (!leftState)
+ {
+ if (controls.ACCEPT)
+ {
leftState = true;
CoolUtil.browserLoad("https://github.com/ShadowMario/FNF-PsychEngine/releases");
}
- else if(controls.BACK) {
+ else if (controls.BACK)
+ {
leftState = true;
}
- if(leftState)
+ if (leftState)
{
FlxG.sound.play(backend.utils.Paths.sound('cancelMenu'));
FlxTween.tween(warnText, {alpha: 0}, 1, {
- onComplete: function (twn:FlxTween) {
+ onComplete: function(twn:FlxTween)
+ {
MusicBeatState.switchState(new game.states.MainMenuState());
}
});
diff --git a/source/game/states/TitleState.hx b/source/game/states/TitleState.hx
index 1a15471e..ae713fd0 100644
--- a/source/game/states/TitleState.hx
+++ b/source/game/states/TitleState.hx
@@ -24,7 +24,7 @@ import sys.FileSystem;
import sys.io.File;
#end
import game.options.GraphicsSettingsSubState;
-//import flixel.graphics.FlxGraphic;
+// import flixel.graphics.FlxGraphic;
import flixel.graphics.frames.FlxAtlasFrames;
import flixel.graphics.frames.FlxFrame;
import flixel.group.FlxGroup;
@@ -46,9 +46,9 @@ import backend.client.Discord.DiscordClient;
import backend.system.MusicBeatState;
using StringTools;
+
typedef TitleData =
{
-
titlex:Float,
titley:Float,
startx:Float,
@@ -58,6 +58,7 @@ typedef TitleData =
backgroundSprite:String,
bpm:Int
}
+
class TitleState extends MusicBeatState
{
public static var muteKeys:Array = [FlxKey.ZERO];
@@ -71,7 +72,7 @@ class TitleState extends MusicBeatState
var credTextShit:game.objects.Alphabet;
var textGroup:FlxGroup;
var ngSpr:FlxSprite;
-
+
var titleTextColors:Array = [0xFF33FFFF, 0xFF3333CC];
var titleTextAlphas:Array = [1, .64];
@@ -79,14 +80,6 @@ class TitleState extends MusicBeatState
var wackyImage:FlxSprite;
- #if TITLE_SCREEN_EASTER_EGG
- var easterEggKeys:Array = [
- 'SHADOW', 'RIVER', 'SHUBS', 'BBPANZU'
- ];
- var allowedKeys:String = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
- var easterEggKeysBuffer:String = '';
- #end
-
var mustUpdate:Bool = false;
var titleJSON:TitleData;
@@ -96,8 +89,9 @@ class TitleState extends MusicBeatState
override public function create():Void
{
FlxG.mouse.visible = false;
- if(backend.utils.ClientPrefs.data.mouseEvents && !backend.utils.ClientPrefs.data.lowQuality) FlxG.mouse.visible = true;
-
+ if (backend.utils.ClientPrefs.data.mouseEvents && !backend.utils.ClientPrefs.data.lowQuality)
+ FlxG.mouse.visible = true;
+
backend.utils.Paths.clearStoredMemory();
backend.utils.Paths.clearUnusedMemory();
@@ -106,34 +100,34 @@ class TitleState extends MusicBeatState
#end
var maxS = FlxG.save.data.maxScore;
var mostM = FlxG.save.data.mostMisses;
- if(maxS != null)
+ if (maxS != null)
trace(FlxG.save.data.maxScore);
- if(mostM != null)
+ if (mostM != null)
trace(FlxG.save.data.mostMisses);
StatChangeables.loadStats();
// Just to load a mod on start up if ya got one. For mods that change the menu music and bg
WeekData.loadTheFirstEnabledMod();
- //trace(path, FileSystem.exists(path));
+ // trace(path, FileSystem.exists(path));
/*#if (polymod && !html5)
- if (sys.FileSystem.exists('mods/')) {
- var folders:Array = [];
- for (file in sys.FileSystem.readDirectory('mods/')) {
- var path = haxe.io.Path.join(['mods/', file]);
- if (sys.FileSystem.isDirectory(path)) {
- folders.push(file);
+ if (sys.FileSystem.exists('mods/')) {
+ var folders:Array = [];
+ for (file in sys.FileSystem.readDirectory('mods/')) {
+ var path = haxe.io.Path.join(['mods/', file]);
+ if (sys.FileSystem.isDirectory(path)) {
+ folders.push(file);
+ }
+ }
+ if(folders.length > 0) {
+ polymod.Polymod.init({modRoot: "mods", dirs: folders});
}
}
- if(folders.length > 0) {
- polymod.Polymod.init({modRoot: "mods", dirs: folders});
- }
- }
- #end*/
+ #end */
#if desktop
// Updating Discord Rich Presence
- DiscordClient.changePresence("Viewing The Title", null);
+ DiscordClient.changePresence("Viewing The Title", null);
#end
FlxG.game.focusLostFramerate = 60;
@@ -156,25 +150,28 @@ class TitleState extends MusicBeatState
backend.utils.ClientPrefs.loadPrefs();
#if CHECK_FOR_UPDATES
- if(backend.utils.ClientPrefs.data.checkForUpdates && !closedState) {
+ if (backend.utils.ClientPrefs.data.checkForUpdates && !closedState)
+ {
trace('checking for update');
- //var http = new haxe.Http("https://raw.githubusercontent.com/ShadowMario/FNF-PsychEngine/main/gitVersion.txt");
+ // var http = new haxe.Http("https://raw.githubusercontent.com/ShadowMario/FNF-PsychEngine/main/gitVersion.txt");
var http = new haxe.Http("https://raw.githubusercontent.com/Hackx2/FNF-AstroEngine/main/gitVersion.txt");
- http.onData = function (data:String)
+ http.onData = function(data:String)
{
updateVersion = data.split('\n')[0].trim();
-
+
var curVersion:String = EngineData.mainCoreShit.coreVersion.trim();
trace('version online: ' + updateVersion + ', your version: ' + curVersion);
- if(updateVersion != curVersion) {
+ if (updateVersion != curVersion)
+ {
trace('versions arent matching!');
mustUpdate = true;
}
}
- http.onError = function (error) {
+ http.onError = function(error)
+ {
trace('error: $error');
}
@@ -187,31 +184,12 @@ class TitleState extends MusicBeatState
// IGNORE THIS!!!
titleJSON = Json.parse(backend.utils.Paths.getTextFromFile('images/gfDanceTitle.json'));
- #if TITLE_SCREEN_EASTER_EGG
- if (FlxG.save.data.psychDevsEasterEgg == null) FlxG.save.data.psychDevsEasterEgg = ''; //Crash prevention
- switch(FlxG.save.data.psychDevsEasterEgg.toUpperCase())
- {
- case 'SHADOW':
- titleJSON.gfx += 210;
- titleJSON.gfy += 40;
- case 'RIVER':
- titleJSON.gfx += 100;
- titleJSON.gfy += 20;
- case 'SHUBS':
- titleJSON.gfx += 160;
- titleJSON.gfy -= 10;
- case 'BBPANZU':
- titleJSON.gfx += 45;
- titleJSON.gfy += 100;
- }
- #end
-
- if(!initialized)
+ if (!initialized)
{
- if(FlxG.save.data != null && FlxG.save.data.fullscreen)
+ if (FlxG.save.data != null && FlxG.save.data.fullscreen)
{
FlxG.fullscreen = FlxG.save.data.fullscreen;
- //trace('LOADED FULLSCREEN SETTING!!');
+ // trace('LOADED FULLSCREEN SETTING!!');
}
persistentUpdate = true;
persistentDraw = true;
@@ -228,11 +206,14 @@ class TitleState extends MusicBeatState
#elseif CHARTING
MusicBeatState.switchState(new ChartingState());
#else
- if(FlxG.save.data.flashing == null && !game.states.FlashingState.leftState) {
+ if (FlxG.save.data.flashing == null && !game.states.FlashingState.leftState)
+ {
FlxTransitionableState.skipNextTransIn = true;
FlxTransitionableState.skipNextTransOut = true;
MusicBeatState.switchState(new game.states.FlashingState());
- } else {
+ }
+ else
+ {
if (initialized)
startIntro();
else
@@ -257,16 +238,16 @@ class TitleState extends MusicBeatState
if (!initialized)
{
/*var diamond:FlxGraphic = FlxGraphic.fromClass(GraphicTransTileDiamond);
- diamond.persist = true;
- diamond.destroyOnNoUse = false;
+ 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(-300, -300, FlxG.width * 1.8, FlxG.height * 1.8));
- FlxTransitionableState.defaultTransOut = new TransitionData(FADE, FlxColor.BLACK, 0.7, new FlxPoint(0, 1),
- {asset: diamond, width: 32, height: 32}, new FlxRect(-300, -300, FlxG.width * 1.8, FlxG.height * 1.8));
+ FlxTransitionableState.defaultTransIn = new TransitionData(FADE, FlxColor.BLACK, 1, new FlxPoint(0, -1), {asset: diamond, width: 32, height: 32},
+ new FlxRect(-300, -300, FlxG.width * 1.8, FlxG.height * 1.8));
+ FlxTransitionableState.defaultTransOut = new TransitionData(FADE, FlxColor.BLACK, 0.7, new FlxPoint(0, 1),
+ {asset: diamond, width: 32, height: 32}, new FlxRect(-300, -300, FlxG.width * 1.8, FlxG.height * 1.8));
- transIn = FlxTransitionableState.defaultTransIn;
- transOut = FlxTransitionableState.defaultTransOut;*/
+ transIn = FlxTransitionableState.defaultTransIn;
+ transOut = FlxTransitionableState.defaultTransOut; */
// HAD TO MODIFY SOME BACKEND SHIT
// IF THIS PR IS HERE IF ITS ACCEPTED UR GOOD TO GO
@@ -277,7 +258,8 @@ class TitleState extends MusicBeatState
// FlxG.sound.list.add(music);
// music.play();
- if(FlxG.sound.music == null) {
+ if (FlxG.sound.music == null)
+ {
FlxG.sound.playMusic(backend.utils.Paths.music('freakyMenu'), 0);
}
}
@@ -287,9 +269,12 @@ class TitleState extends MusicBeatState
var bg:FlxSprite = new FlxSprite();
- if (titleJSON.backgroundSprite != null && titleJSON.backgroundSprite.length > 0 && titleJSON.backgroundSprite != "none"){
+ if (titleJSON.backgroundSprite != null && titleJSON.backgroundSprite.length > 0 && titleJSON.backgroundSprite != "none")
+ {
bg.loadGraphic(backend.utils.Paths.image(titleJSON.backgroundSprite));
- }else{
+ }
+ else
+ {
bg.makeGraphic(FlxG.width, FlxG.height, FlxColor.BLACK);
}
@@ -312,37 +297,13 @@ class TitleState extends MusicBeatState
gfDance = new FlxSprite(titleJSON.gfx, titleJSON.gfy);
var easterEgg:String = FlxG.save.data.psychDevsEasterEgg;
- if(easterEgg == null) easterEgg = ''; //html5 fix
+ if (easterEgg == null)
+ easterEgg = '';
- switch(easterEgg.toUpperCase())
- {
- #if TITLE_SCREEN_EASTER_EGG
- case 'SHADOW':
- gfDance.frames = backend.utils.Paths.getSparrowAtlas('ShadowBump');
- gfDance.animation.addByPrefix('danceLeft', 'Shadow Title Bump', 24);
- gfDance.animation.addByPrefix('danceRight', 'Shadow Title Bump', 24);
- case 'RIVER':
- gfDance.frames = backend.utils.Paths.getSparrowAtlas('RiverBump');
- gfDance.animation.addByIndices('danceLeft', 'River Title Bump', [15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29], "", 24, false);
- gfDance.animation.addByIndices('danceRight', 'River Title Bump', [29, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14], "", 24, false);
- case 'SHUBS':
- gfDance.frames = backend.utils.Paths.getSparrowAtlas('ShubBump');
- gfDance.animation.addByPrefix('danceLeft', 'Shub Title Bump', 24, false);
- gfDance.animation.addByPrefix('danceRight', 'Shub Title Bump', 24, false);
- case 'BBPANZU':
- gfDance.frames = backend.utils.Paths.getSparrowAtlas('BBBump');
- gfDance.animation.addByIndices('danceLeft', 'BB Title Bump', [14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27], "", 24, false);
- gfDance.animation.addByIndices('danceRight', 'BB Title Bump', [27, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13], "", 24, false);
- #end
+ gfDance.frames = backend.utils.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('danceRight', 'gfDance', [15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29], "", 24, false);
- default:
- //EDIT THIS ONE IF YOU'RE MAKING A SOURCE CODE MOD!!!!
- //EDIT THIS ONE IF YOU'RE MAKING A SOURCE CODE MOD!!!!
- //EDIT THIS ONE IF YOU'RE MAKING A SOURCE CODE MOD!!!!
- gfDance.frames = backend.utils.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('danceRight', 'gfDance', [15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29], "", 24, false);
- }
gfDance.antialiasing = backend.utils.ClientPrefs.data.globalAntialiasing;
add(gfDance);
@@ -353,18 +314,19 @@ class TitleState extends MusicBeatState
titleText = new FlxSprite((titleJSON.startx + 30), titleJSON.starty);
#if (desktop && MODS_ALLOWED)
var path = "mods/" + backend.utils.Paths.currentModDirectory + "/images/titleEnter.png";
- //trace(path, FileSystem.exists(path));
- if (!FileSystem.exists(path)){
+ // trace(path, FileSystem.exists(path));
+ if (!FileSystem.exists(path))
+ {
path = "mods/images/titleEnter.png";
}
- //trace(path, FileSystem.exists(path));
- if (!FileSystem.exists(path)){
+ // trace(path, FileSystem.exists(path));
+ if (!FileSystem.exists(path))
+ {
path = "assets/images/titleEnter.png";
}
- //trace(path, FileSystem.exists(path));
- titleText.frames = FlxAtlasFrames.fromSparrow(BitmapData.fromFile(path),File.getContent(StringTools.replace(path,".png",".xml")));
+ // trace(path, FileSystem.exists(path));
+ titleText.frames = FlxAtlasFrames.fromSparrow(BitmapData.fromFile(path), File.getContent(StringTools.replace(path, ".png", ".xml")));
#else
-
titleText.frames = backend.utils.Paths.getSparrowAtlas('titleEnter');
#end
var animFrames:Array = [];
@@ -372,24 +334,26 @@ class TitleState extends MusicBeatState
titleText.animation.findByPrefix(animFrames, "ENTER IDLE");
titleText.animation.findByPrefix(animFrames, "ENTER FREEZE");
}
-
- if (animFrames.length > 0) {
+
+ if (animFrames.length > 0)
+ {
newTitle = true;
-
+
titleText.animation.addByPrefix('idle', "ENTER IDLE", 24);
titleText.animation.addByPrefix('press', backend.utils.ClientPrefs.data.flashing ? "ENTER PRESSED" : "ENTER FREEZE", 24);
}
- else {
+ else
+ {
newTitle = false;
-
+
titleText.animation.addByPrefix('idle', "Press Enter to Begin", 24);
titleText.animation.addByPrefix('press', "ENTER PRESSED", 24);
}
-
+
titleText.antialiasing = backend.utils.ClientPrefs.data.globalAntialiasing;
titleText.animation.play('idle');
titleText.updateHitbox();
- //titleText.screenCenter(X);
+ // titleText.screenCenter(X);
add(titleText);
var logo:FlxSprite = new FlxSprite().loadGraphic(backend.utils.Paths.image('logo'));
@@ -448,8 +412,9 @@ class TitleState extends MusicBeatState
}
var transitioning:Bool = false;
+
private static var playJingle:Bool = false;
-
+
var newTitle:Bool = false;
var titleTimer:Float = 0;
@@ -483,10 +448,12 @@ class TitleState extends MusicBeatState
pressedEnter = true;
#end
}
-
- if (newTitle) {
+
+ if (newTitle)
+ {
titleTimer += CoolUtil.boundTo(elapsed, 0, 1);
- if (titleTimer > 2) titleTimer -= 2;
+ if (titleTimer > 2)
+ titleTimer -= 2;
}
// EASTER EGG
@@ -498,19 +465,20 @@ class TitleState extends MusicBeatState
var timer:Float = titleTimer;
if (timer >= 1)
timer = (-timer) + 2;
-
+
timer = FlxEase.quadInOut(timer);
-
+
titleText.color = FlxColor.interpolate(titleTextColors[0], titleTextColors[1], timer);
titleText.alpha = FlxMath.lerp(titleTextAlphas[0], titleTextAlphas[1], timer);
}
-
- if(pressedEnter)
+
+ if (pressedEnter)
{
titleText.color = FlxColor.WHITE;
titleText.alpha = 1;
-
- if(titleText != null) titleText.animation.play('press');
+
+ if (titleText != null)
+ titleText.animation.play('press');
FlxG.camera.flash(backend.utils.ClientPrefs.data.flashing ? FlxColor.WHITE : 0x4CFFFFFF, 1);
FlxG.sound.play(backend.utils.Paths.sound('confirmMenu'), 0.7);
@@ -520,65 +488,17 @@ class TitleState extends MusicBeatState
new FlxTimer().start(1, function(tmr:FlxTimer)
{
- if (mustUpdate) {
+ if (mustUpdate)
+ {
MusicBeatState.switchState(new game.states.OutdatedState());
- } else {
+ }
+ else
+ {
MusicBeatState.switchState(new game.states.MainMenuState());
}
closedState = true;
});
- // FlxG.sound.play(backend.utils.Paths.music('titleShoot'), 0.7);
- }
- #if TITLE_SCREEN_EASTER_EGG
- else if (FlxG.keys.firstJustPressed() != FlxKey.NONE)
- {
- var keyPressed:FlxKey = FlxG.keys.firstJustPressed();
- var keyName:String = Std.string(keyPressed);
- if(allowedKeys.contains(keyName)) {
- easterEggKeysBuffer += keyName;
- if(easterEggKeysBuffer.length >= 32) easterEggKeysBuffer = easterEggKeysBuffer.substring(1);
- //trace('Test! Allowed Key pressed!!! Buffer: ' + easterEggKeysBuffer);
-
- for (wordRaw in easterEggKeys)
- {
- var word:String = wordRaw.toUpperCase(); //just for being sure you're doing it right
- if (easterEggKeysBuffer.contains(word))
- {
- //trace('YOOO! ' + word);
- if (FlxG.save.data.psychDevsEasterEgg == word)
- FlxG.save.data.psychDevsEasterEgg = '';
- else
- FlxG.save.data.psychDevsEasterEgg = word;
- FlxG.save.flush();
-
- FlxG.sound.play(backend.utils.Paths.sound('ToggleJingle'));
-
- var black:FlxSprite = new FlxSprite(0, 0).makeGraphic(FlxG.width, FlxG.height, FlxColor.BLACK);
- black.alpha = 0;
- add(black);
-
- FlxTween.tween(black, {alpha: 1}, 1, {onComplete:
- function(twn:FlxTween) {
- FlxTransitionableState.skipNextTransIn = true;
- FlxTransitionableState.skipNextTransOut = true;
- MusicBeatState.switchState(new TitleState());
- }
- });
- FlxG.sound.music.fadeOut();
- if(game.states.FreeplayState.vocals != null)
- {
- game.states.FreeplayState.vocals.fadeOut();
- }
- closedState = true;
- transitioning = true;
- playJingle = true;
- easterEggKeysBuffer = '';
- break;
- }
- }
- }
}
- #end
}
if (initialized && pressedEnter && !skippedIntro)
@@ -586,10 +506,12 @@ class TitleState extends MusicBeatState
skipIntro();
}
- if(swagShader != null)
+ if (swagShader != null)
{
- if(controls.UI_LEFT) swagShader.hue -= elapsed * 0.1;
- if(controls.UI_RIGHT) swagShader.hue += elapsed * 0.1;
+ if (controls.UI_LEFT)
+ swagShader.hue -= elapsed * 0.1;
+ if (controls.UI_RIGHT)
+ swagShader.hue += elapsed * 0.1;
}
super.update(elapsed);
@@ -602,7 +524,8 @@ class TitleState extends MusicBeatState
var money:game.objects.Alphabet = new game.objects.Alphabet(0, 0, textArray[i], true);
money.screenCenter(X);
money.y += (i * 60) + 200 + offset;
- if(credGroup != null && textGroup != null) {
+ if (credGroup != null && textGroup != null)
+ {
credGroup.add(money);
textGroup.add(money);
}
@@ -611,7 +534,8 @@ class TitleState extends MusicBeatState
function addMoreText(text:String, ?offset:Float = 0)
{
- if(textGroup != null && credGroup != null) {
+ if (textGroup != null && credGroup != null)
+ {
var coolText:game.objects.Alphabet = new game.objects.Alphabet(0, 0, text, true);
coolText.screenCenter(X);
coolText.y += (textGroup.length * 60) + 200 + offset;
@@ -629,16 +553,19 @@ class TitleState extends MusicBeatState
}
}
- private var sickBeats:Int = 0; //Basically curBeat but won't be skipped if you hold the tab or resize the screen
+ private var sickBeats:Int = 0; // Basically curBeat but won't be skipped if you hold the tab or resize the screen
+
public static var closedState:Bool = false;
+
override function beatHit()
{
super.beatHit();
- if(logoBl != null)
+ if (logoBl != null)
logoBl.animation.play('bump', true);
- if(gfDance != null) {
+ if (gfDance != null)
+ {
danceLeft = !danceLeft;
if (danceLeft)
gfDance.animation.play('danceRight');
@@ -646,19 +573,19 @@ class TitleState extends MusicBeatState
gfDance.animation.play('danceLeft');
}
- if(!closedState) {
+ if (!closedState)
+ {
sickBeats++;
switch (sickBeats)
{
case 1:
- //FlxG.sound.music.stop();
+ // FlxG.sound.music.stop();
FlxG.sound.playMusic(backend.utils.Paths.music('freakyMenu'), 0);
FlxG.sound.music.fadeIn(4, 0, 0.7);
case 2:
createCoolText(['ninjamuffin99', 'phantomArcade', 'kawaisprite', 'evilsk8er']);
// credTextShit.visible = true;
case 4:
-
addMoreText('present');
// credTextShit.text += '\npresent...';
// credTextShit.addText();
@@ -708,18 +635,20 @@ class TitleState extends MusicBeatState
var skippedIntro:Bool = false;
var increaseVolume:Bool = false;
+
function skipIntro():Void
- {
+ {
if (!skippedIntro)
{
- if (playJingle) //Ignore deez
+ if (playJingle) // Ignore deez
{
var easteregg:String = FlxG.save.data.psychDevsEasterEgg;
- if (easteregg == null) easteregg = '';
+ if (easteregg == null)
+ easteregg = '';
easteregg = easteregg.toUpperCase();
var sound:FlxSound = null;
- switch(easteregg)
+ switch (easteregg)
{
case 'RIVER':
sound = FlxG.sound.play(backend.utils.Paths.sound('JingleRiver'));
@@ -730,7 +659,7 @@ class TitleState extends MusicBeatState
case 'BBPANZU':
sound = FlxG.sound.play(backend.utils.Paths.sound('JingleBB'));
- default: //Go back to normal ugly ass boring GF
+ default: // Go back to normal ugly ass boring GF
remove(ngSpr);
remove(credGroup);
FlxG.camera.flash(FlxColor.WHITE, 2);
@@ -743,7 +672,7 @@ class TitleState extends MusicBeatState
}
transitioning = true;
- if(easteregg == 'SHADOW')
+ if (easteregg == 'SHADOW')
{
new FlxTimer().start(3.2, function(tmr:FlxTimer)
{
@@ -758,7 +687,8 @@ class TitleState extends MusicBeatState
remove(ngSpr);
remove(credGroup);
FlxG.camera.flash(FlxColor.WHITE, 3);
- sound.onComplete = function() {
+ sound.onComplete = function()
+ {
FlxG.sound.playMusic(backend.utils.Paths.music('freakyMenu'), 0);
FlxG.sound.music.fadeIn(4, 0, 0.7);
transitioning = false;
@@ -766,25 +696,16 @@ class TitleState extends MusicBeatState
}
playJingle = false;
}
- else //Default! Edit this one!!
+ else // Default! Edit this one!!
{
remove(ngSpr);
remove(credGroup);
FlxG.camera.flash(FlxColor.WHITE, 4);
var easteregg:String = FlxG.save.data.psychDevsEasterEgg;
- if (easteregg == null) easteregg = '';
+ if (easteregg == null)
+ easteregg = '';
easteregg = easteregg.toUpperCase();
- #if TITLE_SCREEN_EASTER_EGG
- if(easteregg == 'SHADOW')
- {
- FlxG.sound.music.fadeOut();
- if(game.states.FreeplayState.vocals != null)
- {
- game.states.FreeplayState.vocals.fadeOut();
- }
- }
- #end
}
skippedIntro = true;
}
diff --git a/source/game/states/substates/GameplayChangersSubstate.hx b/source/game/states/substates/GameplayChangersSubstate.hx
index 6ef5d9b1..e548571c 100644
--- a/source/game/states/substates/GameplayChangersSubstate.hx
+++ b/source/game/states/substates/GameplayChangersSubstate.hx
@@ -26,6 +26,8 @@ import flixel.input.keyboard.FlxKey;
import flixel.graphics.FlxGraphic;
import backend.utils.Controls;
import backend.system.MusicBeatSubstate;
+import game.options.objects.CheckboxThingie;
+import game.objects.Alphabet;
using StringTools;
@@ -35,8 +37,8 @@ class GameplayChangersSubstate extends MusicBeatSubstate
private var curSelected:Int = 0;
private var optionsArray:Array = [];
- private var grpOptions:FlxTypedGroup;
- private var checkboxGroup:FlxTypedGroup;
+ private var grpOptions:FlxTypedGroup;
+ private var checkboxGroup:FlxTypedGroup;
private var grpTexts:FlxTypedGroup;
function getOptions()
@@ -118,20 +120,20 @@ class GameplayChangersSubstate extends MusicBeatSubstate
add(bg);
// avoids lagspikes while scrolling through menus!
- grpOptions = new FlxTypedGroup();
+ grpOptions = new FlxTypedGroup();
add(grpOptions);
grpTexts = new FlxTypedGroup();
add(grpTexts);
- checkboxGroup = new FlxTypedGroup();
+ checkboxGroup = new FlxTypedGroup();
add(checkboxGroup);
getOptions();
for (i in 0...optionsArray.length)
{
- var optionText:game.objects.Alphabet = new game.objects.Alphabet(200, 360, optionsArray[i].name, true);
+ var optionText:Alphabet = new Alphabet(200, 360, optionsArray[i].name, true);
optionText.isMenuItem = true;
optionText.scaleX = 0.8;
optionText.scaleY = 0.8;
@@ -142,7 +144,7 @@ class GameplayChangersSubstate extends MusicBeatSubstate
optionText.x += 110;
optionText.startPosition.x += 110;
optionText.snapToPosition();
- var checkbox:game.options.CheckboxThingie = new game.options.CheckboxThingie(optionText.x - 105, optionText.y, optionsArray[i].getValue() == true);
+ var checkbox:CheckboxThingie = new CheckboxThingie(optionText.x - 105, optionText.y, optionsArray[i].getValue() == true);
checkbox.sprTracker = optionText;
checkbox.offsetX -= 32;
checkbox.offsetY = -120;
@@ -384,7 +386,7 @@ class GameplayChangersSubstate extends MusicBeatSubstate
class GameplayOption
{
- private var child:game.objects.Alphabet;
+ private var child:Alphabet;
public var text(get, set):String;
public var onChange:Void->Void = null; //Pressed enter (on Bool type options) or pressed/held left/right (on other types)
@@ -473,7 +475,7 @@ class GameplayOption
backend.utils.ClientPrefs.data.gameplaySettings.set(variable, value);
}
- public function setChild(child:game.objects.Alphabet)
+ public function setChild(child:Alphabet)
{
this.child = child;
}