diff --git a/source/FreeplayState.hx b/source/FreeplayState.hx new file mode 100644 index 000000000..1cd5e1dd1 --- /dev/null +++ b/source/FreeplayState.hx @@ -0,0 +1,54 @@ +package; + +import flixel.FlxG; +import flixel.FlxSprite; +import flixel.text.FlxText; + +class FreeplayState extends MusicBeatState +{ + var songs:Array = ["Bopeebo", "Dadbattle", "Fresh", "Tutorial"]; + + var selector:FlxText; + var curSelected:Int = 0; + + override function create() + { + // LOAD MUSIC + + // LOAD CHARACTERS + + for (i in 0...songs.length) + { + var songText:FlxText = new FlxText(10, (26 * i) + 30, 0, songs[i], 24); + add(songText); + } + + selector = new FlxText(); + selector.size = 24; + selector.text = ">"; + add(selector); + + super.create(); + } + + override function update(elapsed:Float) + { + if (FlxG.keys.justPressed.UP) + { + curSelected -= 1; + } + if (FlxG.keys.justPressed.DOWN) + { + curSelected += 1; + } + + if (curSelected < 0) + curSelected = songs.length - 1; + if (curSelected >= songs.length) + curSelected = 0; + + selector.y = (26 * curSelected) + 30; + + super.update(elapsed); + } +} diff --git a/source/Main.hx b/source/Main.hx index 13376db44..d4bd9a4a7 100644 --- a/source/Main.hx +++ b/source/Main.hx @@ -9,7 +9,7 @@ class Main extends Sprite public function new() { super(); - addChild(new FlxGame(0, 0, TitleState)); + addChild(new FlxGame(0, 0, ChartingState)); #if !mobile addChild(new FPS(10, 3, 0xFFFFFF)); diff --git a/source/NoteMeta.hx b/source/NoteMeta.hx deleted file mode 100644 index a681aad18..000000000 --- a/source/NoteMeta.hx +++ /dev/null @@ -1,15 +0,0 @@ -package; - -class NoteMeta -{ - public var strumTime:Float = 0; - public var noteData:Int = 0; - public var sustainLength:Float = 0; - - public function new(strumTime:Float, noteData:Int, sustain:Float) - { - this.strumTime = strumTime; - this.noteData = noteData; - sustainLength = sustain; - } -} diff --git a/source/TitleState.hx b/source/TitleState.hx index 057aff8f9..b575df457 100644 --- a/source/TitleState.hx +++ b/source/TitleState.hx @@ -113,7 +113,12 @@ class TitleState extends MusicBeatState pressedEnter = true; } - if (pressedEnter && !transitioning) + if (pressedEnter && !skippedIntro) + { + skipIntro(); + } + + if (pressedEnter && !transitioning && skippedIntro) { FlxG.camera.flash(FlxColor.WHITE, 1); @@ -170,8 +175,18 @@ class TitleState extends MusicBeatState credTextShit.text += '\nFunkin'; case 16: - FlxG.camera.flash(FlxColor.WHITE, 4); - remove(credGroup); + skipIntro(); + } + } + + var skippedIntro:Bool = false; + + function skipIntro():Void + { + if (!skippedIntro) + { + FlxG.camera.flash(FlxColor.WHITE, 4); + remove(credGroup); } } }