1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2024-11-23 15:26:06 +00:00

recharted Fresh

This commit is contained in:
Cameron Taylor 2020-10-21 11:05:27 -07:00
parent f8dfa98d37
commit 7402784e05
4 changed files with 73 additions and 19 deletions

54
source/FreeplayState.hx Normal file
View file

@ -0,0 +1,54 @@
package;
import flixel.FlxG;
import flixel.FlxSprite;
import flixel.text.FlxText;
class FreeplayState extends MusicBeatState
{
var songs:Array<String> = ["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);
}
}

View file

@ -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));

View file

@ -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;
}
}

View file

@ -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);
}
}
}