diff --git a/assets/data/smash/smash.json b/assets/data/smash/smash.json new file mode 100644 index 0000000..3eb9cdf Binary files /dev/null and b/assets/data/smash/smash.json differ diff --git a/source/ChartingState.hx b/source/ChartingState.hx index b521a01..725331b 100644 --- a/source/ChartingState.hx +++ b/source/ChartingState.hx @@ -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); diff --git a/source/Main.hx b/source/Main.hx index d4bd9a4..a4040a1 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, ChartingState)); + addChild(new FlxGame(0, 0, PlayState)); #if !mobile addChild(new FPS(10, 3, 0xFFFFFF)); diff --git a/source/PlayState.hx b/source/PlayState.hx index 631efd1..11c017e 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -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)); diff --git a/source/Song.hx b/source/Song.hx index bd4105b..26b3528 100644 --- a/source/Song.hx +++ b/source/Song.hx @@ -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 = []; - 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;