From f4a02cb5f1d1a7a30164dfba30ee7ca9aa0a3090 Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Mon, 6 Dec 2021 17:49:05 -0500 Subject: [PATCH] FUCKED CHART STUFF RIGHT NOW BUT COMPILES / RUNS --- source/ChartingState.hx | 111 +++++++++++++------------- source/Conductor.hx | 8 +- source/Note.hx | 2 +- source/PlayState.hx | 28 +++---- source/SongLoad.hx | 72 +++++++++++++++-- source/freeplayStuff/FreeplayScore.hx | 17 ++++ 6 files changed, 159 insertions(+), 79 deletions(-) diff --git a/source/ChartingState.hx b/source/ChartingState.hx index 7c08070c5..31e1025c9 100644 --- a/source/ChartingState.hx +++ b/source/ChartingState.hx @@ -39,9 +39,8 @@ import openfl.utils.ByteArray; using Lambda; using StringTools; -using flixel.util.FlxSpriteUtil; +using flixel.util.FlxSpriteUtil; // add in "compiler save" that saves the JSON directly to the debug json using File.write() stuff on windows / sys -// add in "compiler save" that saves the JSON directly to the debug json using File.write() stuff on windows / sys class ChartingState extends MusicBeatState { var _file:FileReference; @@ -132,12 +131,12 @@ class ChartingState extends MusicBeatState { _song = { song: 'Test', - notes: [], + notes: {easy: [], normal: [], hard: []}, bpm: 150, needsVoices: true, player1: 'bf', player2: 'dad', - speed: [], + speed: {easy: 1, normal: 1, hard: 1}, validScore: false, voiceList: ["BF", "BF-pixel"], extraNotes: [] @@ -151,7 +150,7 @@ class ChartingState extends MusicBeatState addSection(); - // sections = _song.notes[SongLoad.curDiff]; + // sections = SongLoad.getSong(); updateGrid(); @@ -242,7 +241,8 @@ class ChartingState extends MusicBeatState var loadAutosaveBtn:FlxButton = new FlxButton(reloadSongJson.x, reloadSongJson.y + 30, 'load autosave', loadAutosave); var stepperSpeed:FlxUINumericStepper = new FlxUINumericStepper(10, 80, 0.1, 1, 0.1, 10, 2); - stepperSpeed.value = _song.speed[SongLoad.curDiff]; + stepperSpeed.value = SongLoad.getSpeed(); + // stepperSpeed.value = _song.speed[SongLoad.curDiff]; stepperSpeed.name = 'song_speed'; var stepperBPM:FlxUINumericStepper = new FlxUINumericStepper(10, 65, 1, 100, 1, 999, 3); @@ -299,7 +299,7 @@ class ChartingState extends MusicBeatState tab_group_section.name = 'Section'; stepperLength = new FlxUINumericStepper(10, 10, 4, 0, 0, 999, 0); - stepperLength.value = _song.notes[SongLoad.curDiff][curSection].lengthInSteps; + stepperLength.value = SongLoad.getSong()[curSection].lengthInSteps; stepperLength.name = "section_length"; stepperSectionBPM = new FlxUINumericStepper(10, 80, 1, Conductor.bpm, 1, 999, 3); @@ -317,11 +317,11 @@ class ChartingState extends MusicBeatState var swapSection:FlxButton = new FlxButton(10, 170, "Swap section", function() { - for (i in 0..._song.notes[SongLoad.curDiff][curSection].sectionNotes.length) + for (i in 0...SongLoad.getSong()[curSection].sectionNotes.length) { - var note = _song.notes[SongLoad.curDiff][curSection].sectionNotes[i]; + var note = SongLoad.getSong()[curSection].sectionNotes[i]; note[1] = (note[1] + 4) % 8; - _song.notes[SongLoad.curDiff][curSection].sectionNotes[i] = note; + SongLoad.getSong()[curSection].sectionNotes[i] = note; updateGrid(); } }); @@ -485,15 +485,15 @@ class ChartingState extends MusicBeatState switch (label) { case 'Must hit section': - _song.notes[SongLoad.curDiff][curSection].mustHitSection = check.checked; + SongLoad.getSong()[curSection].mustHitSection = check.checked; updateHeads(); case 'Change BPM': - _song.notes[SongLoad.curDiff][curSection].changeBPM = check.checked; + SongLoad.getSong()[curSection].changeBPM = check.checked; FlxG.log.add('changed bpm shit'); case "Alt Animation": - _song.notes[SongLoad.curDiff][curSection].altAnim = check.checked; + SongLoad.getSong()[curSection].altAnim = check.checked; } } else if (id == FlxUINumericStepper.CHANGE_EVENT && (sender is FlxUINumericStepper)) @@ -503,12 +503,13 @@ class ChartingState extends MusicBeatState FlxG.log.add(wname); if (wname == 'section_length') { - _song.notes[SongLoad.curDiff][curSection].lengthInSteps = Std.int(nums.value); + SongLoad.getSong()[curSection].lengthInSteps = Std.int(nums.value); updateGrid(); } else if (wname == 'song_speed') { - _song.speed[SongLoad.curDiff] = nums.value; + // _song.speed[SongLoad.curDiff] = nums.value; + _song.speed.normal = nums.value; } else if (wname == 'song_bpm') { @@ -523,7 +524,7 @@ class ChartingState extends MusicBeatState } else if (wname == 'section_bpm') { - _song.notes[SongLoad.curDiff][curSection].bpm = nums.value; + SongLoad.getSong()[curSection].bpm = nums.value; updateGrid(); } } @@ -536,10 +537,10 @@ class ChartingState extends MusicBeatState /* this function got owned LOL function lengthBpmBullshit():Float { - if (_song.notes[SongLoad.curDiff][curSection].changeBPM) - return _song.notes[SongLoad.curDiff][curSection].lengthInSteps * (_song.notes[SongLoad.curDiff][curSection].bpm / _song.bpm); + if (SongLoad.getSong()[curSection].changeBPM) + return SongLoad.getSong()[curSection].lengthInSteps * (SongLoad.getSong()[curSection].bpm / _song.bpm); else - return _song.notes[SongLoad.curDiff][curSection].lengthInSteps; + return SongLoad.getSong()[curSection].lengthInSteps; }*/ function sectionStartTime():Float { @@ -547,9 +548,9 @@ class ChartingState extends MusicBeatState var daPos:Float = 0; for (i in 0...curSection) { - if (_song.notes[SongLoad.curDiff][i].changeBPM) + if (SongLoad.getSong()[i].changeBPM) { - daBPM = _song.notes[SongLoad.curDiff][i].bpm; + daBPM = SongLoad.getSong()[i].bpm; } daPos += 4 * (1000 * 60 / daBPM); } @@ -570,7 +571,7 @@ class ChartingState extends MusicBeatState playheadTest.x = FlxMath.remapToRange(Conductor.songPosition, 0, FlxG.sound.music.length, 0, FlxG.width); - strumLine.y = getYfromStrum((Conductor.songPosition - sectionStartTime()) % (Conductor.stepCrochet * _song.notes[SongLoad.curDiff][curSection].lengthInSteps)); + strumLine.y = getYfromStrum((Conductor.songPosition - sectionStartTime()) % (Conductor.stepCrochet * SongLoad.getSong()[curSection].lengthInSteps)); /* if (FlxG.sound.music.playing) { @@ -585,10 +586,10 @@ class ChartingState extends MusicBeatState if (curBeat % 4 == 0 && curStep >= 16 * (curSection + 1)) { trace(curStep); - trace((_song.notes[SongLoad.curDiff][curSection].lengthInSteps) * (curSection + 1)); + trace((SongLoad.getSong()[curSection].lengthInSteps) * (curSection + 1)); trace('DUMBSHIT'); - if (_song.notes[SongLoad.curDiff][curSection + 1] == null) + if (SongLoad.getSong()[curSection + 1] == null) { addSection(); } @@ -693,7 +694,7 @@ class ChartingState extends MusicBeatState if (FlxG.mouse.x > gridBG.x && FlxG.mouse.x < gridBG.x + gridBG.width && FlxG.mouse.y > gridBG.y - && FlxG.mouse.y < gridBG.y + (GRID_SIZE * _song.notes[SongLoad.curDiff][curSection].lengthInSteps)) + && FlxG.mouse.y < gridBG.y + (GRID_SIZE * SongLoad.getSong()[curSection].lengthInSteps)) { FlxG.log.add('added note'); addNote(); @@ -706,7 +707,7 @@ class ChartingState extends MusicBeatState if (FlxG.mouse.x > gridBG.x && FlxG.mouse.x < gridBG.x + gridBG.width && FlxG.mouse.y > gridBG.y - && FlxG.mouse.y < gridBG.y + (GRID_SIZE * _song.notes[SongLoad.curDiff][curSection].lengthInSteps)) + && FlxG.mouse.y < gridBG.y + (GRID_SIZE * SongLoad.getSong()[curSection].lengthInSteps)) { dummyArrow.x = Math.floor(FlxG.mouse.x / GRID_SIZE) * GRID_SIZE; if (FlxG.keys.pressed.SHIFT) @@ -935,7 +936,7 @@ class ChartingState extends MusicBeatState { trace('changing section' + sec); - if (_song.notes[SongLoad.curDiff][sec] != null) + if (SongLoad.getSong()[sec] != null) { curSection = sec; @@ -968,12 +969,12 @@ class ChartingState extends MusicBeatState { var daSec = FlxMath.maxInt(curSection, sectionNum); - for (note in _song.notes[SongLoad.curDiff][daSec - sectionNum].sectionNotes) + for (note in SongLoad.getSong()[daSec - sectionNum].sectionNotes) { - var strum = note[0] + Conductor.stepCrochet * (_song.notes[SongLoad.curDiff][daSec].lengthInSteps * sectionNum); + var strum = note[0] + Conductor.stepCrochet * (SongLoad.getSong()[daSec].lengthInSteps * sectionNum); var copiedNote:Array = [strum, note[1], note[2]]; - _song.notes[SongLoad.curDiff][daSec].sectionNotes.push(copiedNote); + SongLoad.getSong()[daSec].sectionNotes.push(copiedNote); } updateGrid(); @@ -981,7 +982,7 @@ class ChartingState extends MusicBeatState function updateSectionUI():Void { - var sec = _song.notes[SongLoad.curDiff][curSection]; + var sec = SongLoad.getSong()[curSection]; stepperLength.value = sec.lengthInSteps; check_mustHitSection.checked = sec.mustHitSection; @@ -1042,11 +1043,11 @@ class ChartingState extends MusicBeatState curRenderedSustains.remove(curRenderedSustains.members[0], true); } - var sectionInfo:Array = _song.notes[SongLoad.curDiff][curSection].sectionNotes; + var sectionInfo:Array = SongLoad.getSong()[curSection].sectionNotes; - if (_song.notes[SongLoad.curDiff][curSection].changeBPM && _song.notes[SongLoad.curDiff][curSection].bpm > 0) + if (SongLoad.getSong()[curSection].changeBPM && SongLoad.getSong()[curSection].bpm > 0) { - Conductor.changeBPM(_song.notes[SongLoad.curDiff][curSection].bpm); + Conductor.changeBPM(SongLoad.getSong()[curSection].bpm); FlxG.log.add('CHANGED BPM!'); } else @@ -1054,20 +1055,20 @@ class ChartingState extends MusicBeatState // get last bpm var daBPM:Float = _song.bpm; for (i in 0...curSection) - if (_song.notes[SongLoad.curDiff][i].changeBPM) - daBPM = _song.notes[SongLoad.curDiff][i].bpm; + if (SongLoad.getSong()[i].changeBPM) + daBPM = SongLoad.getSong()[i].bpm; Conductor.changeBPM(daBPM); } /* // PORT BULLSHIT, INCASE THERE'S NO SUSTAIN DATA FOR A NOTE - for (sec in 0..._song.notes[SongLoad.curDiff].length) + for (sec in 0...SongLoad.getSong().length) { - for (notesse in 0..._song.notes[SongLoad.curDiff][sec].sectionNotes.length) + for (notesse in 0...SongLoad.getSong()[sec].sectionNotes.length) { - if (_song.notes[SongLoad.curDiff][sec].sectionNotes[notesse][2] == null) + if (SongLoad.getSong()[sec].sectionNotes[notesse][2] == null) { trace('SUS NULL'); - _song.notes[SongLoad.curDiff][sec].sectionNotes[notesse][2] = 0; + SongLoad.getSong()[sec].sectionNotes[notesse][2] = 0; } } } @@ -1084,7 +1085,7 @@ class ChartingState extends MusicBeatState note.setGraphicSize(GRID_SIZE, GRID_SIZE); note.updateHitbox(); note.x = Math.floor(daNoteInfo * GRID_SIZE); - note.y = Math.floor(getYfromStrum((daStrumTime - sectionStartTime()) % (Conductor.stepCrochet * _song.notes[SongLoad.curDiff][curSection].lengthInSteps))); + note.y = Math.floor(getYfromStrum((daStrumTime - sectionStartTime()) % (Conductor.stepCrochet * SongLoad.getSong()[curSection].lengthInSteps))); curRenderedNotes.add(note); @@ -1109,18 +1110,18 @@ class ChartingState extends MusicBeatState altAnim: false }; - _song.notes[SongLoad.curDiff].push(sec); + SongLoad.getSong().push(sec); } function selectNote(note:Note):Void { var swagNum:Int = 0; - for (i in _song.notes[SongLoad.curDiff][curSection].sectionNotes) + for (i in SongLoad.getSong()[curSection].sectionNotes) { if (i.strumTime == note.strumTime && i.noteData % 4 == note.noteData) { - curSelectedNote = _song.notes[SongLoad.curDiff][curSection].sectionNotes[swagNum]; + curSelectedNote = SongLoad.getSong()[curSection].sectionNotes[swagNum]; } swagNum += 1; @@ -1132,7 +1133,7 @@ class ChartingState extends MusicBeatState function deleteNote(note:Note):Void { - for (i in _song.notes[SongLoad.curDiff][curSection].sectionNotes) + for (i in SongLoad.getSong()[curSection].sectionNotes) { if (i[0] == note.strumTime && i[1] % 4 == note.noteData) { @@ -1146,7 +1147,7 @@ class ChartingState extends MusicBeatState FlxG.sound.play(Paths.sound('funnyNoise/funnyNoise-0' + placeIDK)); FlxG.log.add('FOUND EVIL NUMBER'); - _song.notes[SongLoad.curDiff][curSection].sectionNotes.remove(i); + SongLoad.getSong()[curSection].sectionNotes.remove(i); } } @@ -1155,16 +1156,16 @@ class ChartingState extends MusicBeatState function clearSection():Void { - _song.notes[SongLoad.curDiff][curSection].sectionNotes = []; + SongLoad.getSong()[curSection].sectionNotes = []; updateGrid(); } function clearSong():Void { - for (daSection in 0..._song.notes[SongLoad.curDiff].length) + for (daSection in 0...SongLoad.getSong().length) { - _song.notes[SongLoad.curDiff][daSection].sectionNotes = []; + SongLoad.getSong()[daSection].sectionNotes = []; } updateGrid(); @@ -1204,13 +1205,13 @@ class ChartingState extends MusicBeatState FlxG.sound.play(Paths.sound('pianoStuff/piano-00' + Std.string((bullshit % 8) + 1)), FlxG.random.float(0.3, 0.6)); // trace('bullshit $bullshit'); // trace(Math.floor(dummyArrow.y / GRID_SIZE) * GRID_SIZE); - _song.notes[SongLoad.curDiff][curSection].sectionNotes.push([noteStrum, noteData, noteSus, noteAlt]); + SongLoad.getSong()[curSection].sectionNotes.push([noteStrum, noteData, noteSus, noteAlt]); - curSelectedNote = _song.notes[SongLoad.curDiff][curSection].sectionNotes[_song.notes[SongLoad.curDiff][curSection].sectionNotes.length - 1]; + curSelectedNote = SongLoad.getSong()[curSection].sectionNotes[SongLoad.getSong()[curSection].sectionNotes.length - 1]; if (FlxG.keys.pressed.CONTROL) { - _song.notes[SongLoad.curDiff][curSection].sectionNotes.push([noteStrum, (noteData + 4) % 8, noteSus, noteAlt]); + SongLoad.getSong()[curSection].sectionNotes.push([noteStrum, (noteData + 4) % 8, noteSus, noteAlt]); } trace(noteStrum); @@ -1237,7 +1238,7 @@ class ChartingState extends MusicBeatState { var daLength:Int = 0; - for (i in _song.notes[SongLoad.curDiff]) + for (i in SongLoad.getSong()) { var swagLength = i.lengthInSteps; @@ -1259,14 +1260,14 @@ class ChartingState extends MusicBeatState function loadLevel():Void { - trace(_song.notes[SongLoad.curDiff]); + trace(SongLoad.getSong()); } function getNotes():Array { var noteData:Array = []; - for (i in _song.notes[SongLoad.curDiff]) + for (i in SongLoad.getSong()) { noteData.push(i.sectionNotes); } diff --git a/source/Conductor.hx b/source/Conductor.hx index 0d85c2ad7..a1a010ef7 100644 --- a/source/Conductor.hx +++ b/source/Conductor.hx @@ -33,11 +33,11 @@ class Conductor var curBPM:Float = song.bpm; var totalSteps:Int = 0; var totalPos:Float = 0; - for (i in 0...song.notes[SongLoad.curDiff].length) + for (i in 0...SongLoad.getSong().length) { - if (song.notes[SongLoad.curDiff][i].changeBPM && song.notes[SongLoad.curDiff][i].bpm != curBPM) + if (SongLoad.getSong()[i].changeBPM && SongLoad.getSong()[i].bpm != curBPM) { - curBPM = song.notes[SongLoad.curDiff][i].bpm; + curBPM = SongLoad.getSong()[i].bpm; var event:BPMChangeEvent = { stepTime: totalSteps, songTime: totalPos, @@ -46,7 +46,7 @@ class Conductor bpmChangeMap.push(event); } - var deltaSteps:Int = song.notes[SongLoad.curDiff][i].lengthInSteps; + var deltaSteps:Int = SongLoad.getSong()[i].lengthInSteps; totalSteps += deltaSteps; totalPos += ((60 / curBPM) * 1000 / 4) * deltaSteps; } diff --git a/source/Note.hx b/source/Note.hx index 812441975..bc79d832b 100644 --- a/source/Note.hx +++ b/source/Note.hx @@ -195,7 +195,7 @@ class Note extends FlxSprite prevNote.updateHitbox(); - var scaleThing:Float = Math.round((Conductor.stepCrochet) * (0.45 * FlxMath.roundDecimal(PlayState.SONG.speed[SongLoad.curDiff], 2))); + var scaleThing:Float = Math.round((Conductor.stepCrochet) * (0.45 * FlxMath.roundDecimal(SongLoad.getSpeed(), 2))); // get them a LIL closer together cuz the antialiasing blurs the edges if (antialiasing) scaleThing *= 1.0 + (1.0 / prevNote.frameHeight); diff --git a/source/PlayState.hx b/source/PlayState.hx index 8ee3faf82..c461c238b 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -1573,7 +1573,7 @@ class PlayState extends MusicBeatState var noteData:Array; // NEW SHIT - noteData = SONG.notes[SongLoad.curDiff]; + noteData = SongLoad.getSong(); for (section in noteData) { @@ -2037,9 +2037,9 @@ class PlayState extends MusicBeatState changeSection(-1); #end - if (generatedMusic && SONG.notes[SongLoad.curDiff][Std.int(curStep / 16)] != null) + if (generatedMusic && SongLoad.getSong()[Std.int(curStep / 16)] != null) { - cameraRightSide = SONG.notes[SongLoad.curDiff][Std.int(curStep / 16)].mustHitSection; + cameraRightSide = SongLoad.getSong()[Std.int(curStep / 16)].mustHitSection; cameraMovement(); } @@ -2110,7 +2110,7 @@ class PlayState extends MusicBeatState } } - while (unspawnNotes[0] != null && unspawnNotes[0].strumTime - Conductor.songPosition < 1800 / SONG.speed[SongLoad.curDiff]) + while (unspawnNotes[0] != null && unspawnNotes[0].strumTime - Conductor.songPosition < 1800 / SongLoad.getSpeed()) { var dunceNote:Note = unspawnNotes[0]; notes.add(dunceNote); @@ -2135,7 +2135,7 @@ class PlayState extends MusicBeatState } var strumLineMid = strumLine.y + Note.swagWidth / 2; - daNote.y = (Conductor.songPosition - daNote.strumTime) * (0.45 * FlxMath.roundDecimal(SONG.speed[SongLoad.curDiff], 2)); + daNote.y = (Conductor.songPosition - daNote.strumTime) * (0.45 * FlxMath.roundDecimal(SongLoad.getSpeed(), 2)); if (PreferencesMenu.getPref('downscroll')) { @@ -2172,9 +2172,9 @@ class PlayState extends MusicBeatState var altAnim:String = ""; - if (SONG.notes[SongLoad.curDiff][Math.floor(curStep / 16)] != null) + if (SongLoad.getSong()[Math.floor(curStep / 16)] != null) { - if (SONG.notes[SongLoad.curDiff][Math.floor(curStep / 16)].altAnim) + if (SongLoad.getSong()[Math.floor(curStep / 16)].altAnim) altAnim = '-alt'; } @@ -2291,9 +2291,9 @@ class PlayState extends MusicBeatState var daPos:Float = 0; for (i in 0...(Std.int(curStep / 16 + sec))) { - if (SONG.notes[SongLoad.curDiff][i].changeBPM) + if (SongLoad.getSong()[i].changeBPM) { - daBPM = SONG.notes[SongLoad.curDiff][i].bpm; + daBPM = SongLoad.getSong()[i].bpm; } daPos += 4 * (1000 * 60 / daBPM); } @@ -3070,11 +3070,11 @@ class PlayState extends MusicBeatState notes.sort(sortNotes, FlxSort.DESCENDING); } - if (SONG.notes[SongLoad.curDiff][Math.floor(curStep / 16)] != null) + if (SongLoad.getSong()[Math.floor(curStep / 16)] != null) { - if (SONG.notes[SongLoad.curDiff][Math.floor(curStep / 16)].changeBPM) + if (SongLoad.getSong()[Math.floor(curStep / 16)].changeBPM) { - Conductor.changeBPM(SONG.notes[SongLoad.curDiff][Math.floor(curStep / 16)].bpm); + Conductor.changeBPM(SongLoad.getSong()[Math.floor(curStep / 16)].bpm); FlxG.log.add('CHANGED BPM!'); } // else @@ -3106,9 +3106,9 @@ class PlayState extends MusicBeatState iconP2.updateHitbox(); if (curBeat % 8 == 7 - && SONG.notes[SongLoad.curDiff][Math.floor(curStep / 16)].mustHitSection + && SongLoad.getSong()[Math.floor(curStep / 16)].mustHitSection && combo > 5 - && !SONG.notes[SongLoad.curDiff][Math.floor(curStep / 16) + 1].mustHitSection) + && !SongLoad.getSong()[Math.floor(curStep / 16) + 1].mustHitSection) { var animShit:ComboCounter = new ComboCounter(-100, 300, combo); animShit.scrollFactor.set(0.6, 0.6); diff --git a/source/SongLoad.hx b/source/SongLoad.hx index ac0b0c46b..abf5e8624 100644 --- a/source/SongLoad.hx +++ b/source/SongLoad.hx @@ -10,11 +10,11 @@ using StringTools; typedef SwagSong = { var song:String; - var notes:Map>; + var notes:FunnyNotes; var bpm:Float; var needsVoices:Bool; var voiceList:Array; - var speed:Map; + var speed:FunnySpeed; var player1:String; var player2:String; @@ -22,6 +22,20 @@ typedef SwagSong = var extraNotes:Map>; } +typedef FunnySpeed = +{ + var ?easy:Float; + var ?normal:Float; + var ?hard:Float; +} + +typedef FunnyNotes = +{ + var ?easy:Array; + var ?normal:Array; + var ?hard:Array; +} + class SongLoad { public static var curDiff:String = 'normal'; @@ -57,14 +71,62 @@ class SongLoad return parseJSONshit(rawJson); } + public static function getSong(?diff:String):Array + { + if (diff == null) + diff = SongLoad.curDiff; + + var songShit:Array = []; + switch (diff) + { + case 'easy': + songShit = songData.notes.easy; + case 'normal': + songShit = songData.notes.normal; + case 'hard': + songShit = songData.notes.hard; + } + + return songShit; + } + + public static function getSpeed(?diff:String):Float + { + if (diff == null) + diff = SongLoad.curDiff; + + var speedShit:Float = 1; + switch (diff) + { + case 'easy': + speedShit = songData.speed.easy; + case 'normal': + speedShit = songData.speed.normal; + case 'hard': + speedShit = songData.speed.hard; + } + + return speedShit; + } + public static function parseJSONshit(rawJson:String):SwagSong { var swagShit:SwagSong = cast Json.parse(rawJson).song; - swagShit.validScore = true; - // swagShit.notes[0] = cast Json.parse(rawJson).song.notes[SongLoad.curDiff]; // by default uses - trace(swagShit); + swagShit.validScore = true; + trace("SONG SHIT ABOUTTA WEEK AGOOO"); + for (field in Reflect.fields(Json.parse(rawJson).song.speed)) + { + // swagShit.speed[field] = Reflect.field(Json.parse(rawJson).song.speed, field); + // swagShit.notes[field] = Reflect.field(Json.parse(rawJson).song.notes, field); + // trace(swagShit.notes[field]); + } + + // swagShit.notes = cast Json.parse(rawJson).song.notes[SongLoad.curDiff]; // by default uses + + // trace(swagShit.notes); + trace('THAT SHIT WAS JUST THE NORMAL NOTES!!!'); songData = swagShit; // curNotes = songData.notes.get('normal'); diff --git a/source/freeplayStuff/FreeplayScore.hx b/source/freeplayStuff/FreeplayScore.hx index 8ae314c7c..315f881ea 100644 --- a/source/freeplayStuff/FreeplayScore.hx +++ b/source/freeplayStuff/FreeplayScore.hx @@ -71,6 +71,23 @@ class ScoreNum extends FlxSprite { animation.play(Std.string(val), true, false, 0); updateHitbox(); + + switch (val) + { + case 5: + // set offsets + // offset.x += 0; + // offset.y += 10; + + case 7: + // offset.y += 6; + case 4: + // offset.y += 5; + case 9: + // offset.y += 5; + default: + centerOffsets(false); + } } return val;