1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2024-12-26 15:07:14 +00:00

CLEANED JSON LOL

This commit is contained in:
Cameron Taylor 2020-10-13 22:02:36 -07:00
parent 38bb4848a5
commit f31813c9db
5 changed files with 16 additions and 4 deletions

Binary file not shown.

View file

@ -362,7 +362,7 @@ class ChartingState extends MusicBeatState
"song": curSong,
"bpm": Conductor.bpm,
"sections": sections.length,
'notes': getNotes
'notes': sections
};
var data:String = Json.stringify(json);

View file

@ -9,7 +9,7 @@ class Main extends Sprite
public function new()
{
super();
addChild(new FlxGame(0, 0, ChartingState));
addChild(new FlxGame(0, 0, PlayState));
#if !mobile
addChild(new FPS(10, 3, 0xFFFFFF));

View file

@ -71,7 +71,7 @@ class PlayState extends MusicBeatState
persistentDraw = true;
if (SONG == null)
SONG = Song.loadFromJson('tutorial');
SONG = Song.loadFromJson('smash');
var bg:FlxSprite = new FlxSprite(-600, -200).loadGraphic(AssetPaths.stageback__png);
// bg.setGraphicSize(Std.int(bg.width * 2.5));

View file

@ -3,6 +3,8 @@ package;
import haxe.Json;
import lime.utils.Assets;
using StringTools;
class Song
{
public var song:String;
@ -32,7 +34,17 @@ class Song
var daSong:String = '';
var daSectionLengths:Array<Int> = [];
var songData = Json.parse(Assets.getText('assets/data/' + jsonInput + '/' + jsonInput + '.json'));
var rawJson = Assets.getText('assets/data/' + jsonInput + '/' + jsonInput + '.json').trim();
while (!rawJson.endsWith("}"))
{
rawJson = rawJson.substr(0, rawJson.length - 1);
// LOL GOING THROUGH THE BULLSHIT TO CLEAN IDK WHATS STRANGE
}
trace(rawJson);
var songData = Json.parse(rawJson);
daNotes = songData.notes;
daSong = songData.song;