IN PROGRESS AND WORKING WITH NEW CHART STUFF

This commit is contained in:
Cameron Taylor 2021-11-29 15:26:45 -05:00
parent 8df91344f2
commit 47703418bf
7 changed files with 85 additions and 84 deletions

View file

@ -552,7 +552,7 @@ class Character extends FlxSprite
{ {
var swagshit = Song.loadFromJson('picospeaker', 'stress'); var swagshit = Song.loadFromJson('picospeaker', 'stress');
var notes = swagshit.notes; var notes = swagshit.notes[0];
for (section in notes) for (section in notes)
{ {

View file

@ -132,12 +132,12 @@ class ChartingState extends MusicBeatState
{ {
_song = { _song = {
song: 'Test', song: 'Test',
notes: [], notes: [[]],
bpm: 150, bpm: 150,
needsVoices: true, needsVoices: true,
player1: 'bf', player1: 'bf',
player2: 'dad', player2: 'dad',
speed: 1, speed: [1],
validScore: false, validScore: false,
voiceList: ["BF", "BF-pixel"] voiceList: ["BF", "BF-pixel"]
}; };
@ -150,7 +150,7 @@ class ChartingState extends MusicBeatState
addSection(); addSection();
// sections = _song.notes; // sections = _song.notes[Conductor.curNotes];
updateGrid(); updateGrid();
@ -241,7 +241,7 @@ class ChartingState extends MusicBeatState
var loadAutosaveBtn:FlxButton = new FlxButton(reloadSongJson.x, reloadSongJson.y + 30, 'load autosave', loadAutosave); 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); var stepperSpeed:FlxUINumericStepper = new FlxUINumericStepper(10, 80, 0.1, 1, 0.1, 10, 2);
stepperSpeed.value = _song.speed; stepperSpeed.value = _song.speed[Conductor.curNotes];
stepperSpeed.name = 'song_speed'; stepperSpeed.name = 'song_speed';
var stepperBPM:FlxUINumericStepper = new FlxUINumericStepper(10, 65, 1, 100, 1, 999, 3); var stepperBPM:FlxUINumericStepper = new FlxUINumericStepper(10, 65, 1, 100, 1, 999, 3);
@ -298,7 +298,7 @@ class ChartingState extends MusicBeatState
tab_group_section.name = 'Section'; tab_group_section.name = 'Section';
stepperLength = new FlxUINumericStepper(10, 10, 4, 0, 0, 999, 0); stepperLength = new FlxUINumericStepper(10, 10, 4, 0, 0, 999, 0);
stepperLength.value = _song.notes[curSection].lengthInSteps; stepperLength.value = _song.notes[Conductor.curNotes][curSection].lengthInSteps;
stepperLength.name = "section_length"; stepperLength.name = "section_length";
stepperSectionBPM = new FlxUINumericStepper(10, 80, 1, Conductor.bpm, 1, 999, 3); stepperSectionBPM = new FlxUINumericStepper(10, 80, 1, Conductor.bpm, 1, 999, 3);
@ -316,11 +316,11 @@ class ChartingState extends MusicBeatState
var swapSection:FlxButton = new FlxButton(10, 170, "Swap section", function() var swapSection:FlxButton = new FlxButton(10, 170, "Swap section", function()
{ {
for (i in 0..._song.notes[curSection].sectionNotes.length) for (i in 0..._song.notes[Conductor.curNotes][curSection].sectionNotes.length)
{ {
var note = _song.notes[curSection].sectionNotes[i]; var note = _song.notes[Conductor.curNotes][curSection].sectionNotes[i];
note[1] = (note[1] + 4) % 8; note[1] = (note[1] + 4) % 8;
_song.notes[curSection].sectionNotes[i] = note; _song.notes[Conductor.curNotes][curSection].sectionNotes[i] = note;
updateGrid(); updateGrid();
} }
}); });
@ -468,7 +468,7 @@ class ChartingState extends MusicBeatState
bullshitUI.add(title); bullshitUI.add(title);
/* /*
var loopCheck = new FlxUICheckBox(UI_box.x + 10, UI_box.y + 50, null, null, "Loops", 100, ['loop check']); var loopCheck = new FlxUICheckBox(UI_box.x + 10, UI_box.y + 50, null, null, "Loops", 100, ['loop check']);
loopCheck.checked = curNoteSelected.doesLoop; loopCheck.checked = notes[0]elected.doesLoop;
tooltips.add(loopCheck, {title: 'Section looping', body: "Whether or not it's a simon says style section", style: tooltipType}); tooltips.add(loopCheck, {title: 'Section looping', body: "Whether or not it's a simon says style section", style: tooltipType});
bullshitUI.add(loopCheck); bullshitUI.add(loopCheck);
@ -484,15 +484,15 @@ class ChartingState extends MusicBeatState
switch (label) switch (label)
{ {
case 'Must hit section': case 'Must hit section':
_song.notes[curSection].mustHitSection = check.checked; _song.notes[Conductor.curNotes][curSection].mustHitSection = check.checked;
updateHeads(); updateHeads();
case 'Change BPM': case 'Change BPM':
_song.notes[curSection].changeBPM = check.checked; _song.notes[Conductor.curNotes][curSection].changeBPM = check.checked;
FlxG.log.add('changed bpm shit'); FlxG.log.add('changed bpm shit');
case "Alt Animation": case "Alt Animation":
_song.notes[curSection].altAnim = check.checked; _song.notes[Conductor.curNotes][curSection].altAnim = check.checked;
} }
} }
else if (id == FlxUINumericStepper.CHANGE_EVENT && (sender is FlxUINumericStepper)) else if (id == FlxUINumericStepper.CHANGE_EVENT && (sender is FlxUINumericStepper))
@ -502,12 +502,12 @@ class ChartingState extends MusicBeatState
FlxG.log.add(wname); FlxG.log.add(wname);
if (wname == 'section_length') if (wname == 'section_length')
{ {
_song.notes[curSection].lengthInSteps = Std.int(nums.value); _song.notes[Conductor.curNotes][curSection].lengthInSteps = Std.int(nums.value);
updateGrid(); updateGrid();
} }
else if (wname == 'song_speed') else if (wname == 'song_speed')
{ {
_song.speed = nums.value; _song.speed[Conductor.curNotes] = nums.value;
} }
else if (wname == 'song_bpm') else if (wname == 'song_bpm')
{ {
@ -522,7 +522,7 @@ class ChartingState extends MusicBeatState
} }
else if (wname == 'section_bpm') else if (wname == 'section_bpm')
{ {
_song.notes[curSection].bpm = nums.value; _song.notes[Conductor.curNotes][curSection].bpm = nums.value;
updateGrid(); updateGrid();
} }
} }
@ -535,10 +535,10 @@ class ChartingState extends MusicBeatState
/* this function got owned LOL /* this function got owned LOL
function lengthBpmBullshit():Float function lengthBpmBullshit():Float
{ {
if (_song.notes[curSection].changeBPM) if (_song.notes[Conductor.curNotes][curSection].changeBPM)
return _song.notes[curSection].lengthInSteps * (_song.notes[curSection].bpm / _song.bpm); return _song.notes[Conductor.curNotes][curSection].lengthInSteps * (_song.notes[Conductor.curNotes][curSection].bpm / _song.bpm);
else else
return _song.notes[curSection].lengthInSteps; return _song.notes[Conductor.curNotes][curSection].lengthInSteps;
}*/ }*/
function sectionStartTime():Float function sectionStartTime():Float
{ {
@ -546,9 +546,9 @@ class ChartingState extends MusicBeatState
var daPos:Float = 0; var daPos:Float = 0;
for (i in 0...curSection) for (i in 0...curSection)
{ {
if (_song.notes[i].changeBPM) if (_song.notes[Conductor.curNotes][i].changeBPM)
{ {
daBPM = _song.notes[i].bpm; daBPM = _song.notes[Conductor.curNotes][i].bpm;
} }
daPos += 4 * (1000 * 60 / daBPM); daPos += 4 * (1000 * 60 / daBPM);
} }
@ -569,7 +569,7 @@ class ChartingState extends MusicBeatState
playheadTest.x = FlxMath.remapToRange(Conductor.songPosition, 0, FlxG.sound.music.length, 0, FlxG.width); playheadTest.x = FlxMath.remapToRange(Conductor.songPosition, 0, FlxG.sound.music.length, 0, FlxG.width);
strumLine.y = getYfromStrum((Conductor.songPosition - sectionStartTime()) % (Conductor.stepCrochet * _song.notes[curSection].lengthInSteps)); strumLine.y = getYfromStrum((Conductor.songPosition - sectionStartTime()) % (Conductor.stepCrochet * _song.notes[Conductor.curNotes][curSection].lengthInSteps));
/* if (FlxG.sound.music.playing) /* if (FlxG.sound.music.playing)
{ {
@ -584,10 +584,10 @@ class ChartingState extends MusicBeatState
if (curBeat % 4 == 0 && curStep >= 16 * (curSection + 1)) if (curBeat % 4 == 0 && curStep >= 16 * (curSection + 1))
{ {
trace(curStep); trace(curStep);
trace((_song.notes[curSection].lengthInSteps) * (curSection + 1)); trace((_song.notes[Conductor.curNotes][curSection].lengthInSteps) * (curSection + 1));
trace('DUMBSHIT'); trace('DUMBSHIT');
if (_song.notes[curSection + 1] == null) if (_song.notes[Conductor.curNotes][curSection + 1] == null)
{ {
addSection(); addSection();
} }
@ -692,7 +692,7 @@ class ChartingState extends MusicBeatState
if (FlxG.mouse.x > gridBG.x if (FlxG.mouse.x > gridBG.x
&& FlxG.mouse.x < gridBG.x + gridBG.width && FlxG.mouse.x < gridBG.x + gridBG.width
&& FlxG.mouse.y > gridBG.y && FlxG.mouse.y > gridBG.y
&& FlxG.mouse.y < gridBG.y + (GRID_SIZE * _song.notes[curSection].lengthInSteps)) && FlxG.mouse.y < gridBG.y + (GRID_SIZE * _song.notes[Conductor.curNotes][curSection].lengthInSteps))
{ {
FlxG.log.add('added note'); FlxG.log.add('added note');
addNote(); addNote();
@ -705,7 +705,7 @@ class ChartingState extends MusicBeatState
if (FlxG.mouse.x > gridBG.x if (FlxG.mouse.x > gridBG.x
&& FlxG.mouse.x < gridBG.x + gridBG.width && FlxG.mouse.x < gridBG.x + gridBG.width
&& FlxG.mouse.y > gridBG.y && FlxG.mouse.y > gridBG.y
&& FlxG.mouse.y < gridBG.y + (GRID_SIZE * _song.notes[curSection].lengthInSteps)) && FlxG.mouse.y < gridBG.y + (GRID_SIZE * _song.notes[Conductor.curNotes][curSection].lengthInSteps))
{ {
dummyArrow.x = Math.floor(FlxG.mouse.x / GRID_SIZE) * GRID_SIZE; dummyArrow.x = Math.floor(FlxG.mouse.x / GRID_SIZE) * GRID_SIZE;
if (FlxG.keys.pressed.SHIFT) if (FlxG.keys.pressed.SHIFT)
@ -934,7 +934,7 @@ class ChartingState extends MusicBeatState
{ {
trace('changing section' + sec); trace('changing section' + sec);
if (_song.notes[sec] != null) if (_song.notes[Conductor.curNotes][sec] != null)
{ {
curSection = sec; curSection = sec;
@ -967,12 +967,12 @@ class ChartingState extends MusicBeatState
{ {
var daSec = FlxMath.maxInt(curSection, sectionNum); var daSec = FlxMath.maxInt(curSection, sectionNum);
for (note in _song.notes[daSec - sectionNum].sectionNotes) for (note in _song.notes[Conductor.curNotes][daSec - sectionNum].sectionNotes)
{ {
var strum = note[0] + Conductor.stepCrochet * (_song.notes[daSec].lengthInSteps * sectionNum); var strum = note[0] + Conductor.stepCrochet * (_song.notes[Conductor.curNotes][daSec].lengthInSteps * sectionNum);
var copiedNote:Array<Dynamic> = [strum, note[1], note[2]]; var copiedNote:Array<Dynamic> = [strum, note[1], note[2]];
_song.notes[daSec].sectionNotes.push(copiedNote); _song.notes[Conductor.curNotes][daSec].sectionNotes.push(copiedNote);
} }
updateGrid(); updateGrid();
@ -980,7 +980,7 @@ class ChartingState extends MusicBeatState
function updateSectionUI():Void function updateSectionUI():Void
{ {
var sec = _song.notes[curSection]; var sec = _song.notes[Conductor.curNotes][curSection];
stepperLength.value = sec.lengthInSteps; stepperLength.value = sec.lengthInSteps;
check_mustHitSection.checked = sec.mustHitSection; check_mustHitSection.checked = sec.mustHitSection;
@ -1041,11 +1041,11 @@ class ChartingState extends MusicBeatState
curRenderedSustains.remove(curRenderedSustains.members[0], true); curRenderedSustains.remove(curRenderedSustains.members[0], true);
} }
var sectionInfo:Array<Dynamic> = _song.notes[curSection].sectionNotes; var sectionInfo:Array<Dynamic> = _song.notes[Conductor.curNotes][curSection].sectionNotes;
if (_song.notes[curSection].changeBPM && _song.notes[curSection].bpm > 0) if (_song.notes[Conductor.curNotes][curSection].changeBPM && _song.notes[Conductor.curNotes][curSection].bpm > 0)
{ {
Conductor.changeBPM(_song.notes[curSection].bpm); Conductor.changeBPM(_song.notes[Conductor.curNotes][curSection].bpm);
FlxG.log.add('CHANGED BPM!'); FlxG.log.add('CHANGED BPM!');
} }
else else
@ -1053,20 +1053,20 @@ class ChartingState extends MusicBeatState
// get last bpm // get last bpm
var daBPM:Float = _song.bpm; var daBPM:Float = _song.bpm;
for (i in 0...curSection) for (i in 0...curSection)
if (_song.notes[i].changeBPM) if (_song.notes[Conductor.curNotes][i].changeBPM)
daBPM = _song.notes[i].bpm; daBPM = _song.notes[Conductor.curNotes][i].bpm;
Conductor.changeBPM(daBPM); Conductor.changeBPM(daBPM);
} }
/* // PORT BULLSHIT, INCASE THERE'S NO SUSTAIN DATA FOR A NOTE /* // PORT BULLSHIT, INCASE THERE'S NO SUSTAIN DATA FOR A NOTE
for (sec in 0..._song.notes.length) for (sec in 0..._song.notes[Conductor.curNotes].length)
{ {
for (notesse in 0..._song.notes[sec].sectionNotes.length) for (notesse in 0..._song.notes[Conductor.curNotes][sec].sectionNotes.length)
{ {
if (_song.notes[sec].sectionNotes[notesse][2] == null) if (_song.notes[Conductor.curNotes][sec].sectionNotes[notesse][2] == null)
{ {
trace('SUS NULL'); trace('SUS NULL');
_song.notes[sec].sectionNotes[notesse][2] = 0; _song.notes[Conductor.curNotes][sec].sectionNotes[notesse][2] = 0;
} }
} }
} }
@ -1083,7 +1083,7 @@ class ChartingState extends MusicBeatState
note.setGraphicSize(GRID_SIZE, GRID_SIZE); note.setGraphicSize(GRID_SIZE, GRID_SIZE);
note.updateHitbox(); note.updateHitbox();
note.x = Math.floor(daNoteInfo * GRID_SIZE); note.x = Math.floor(daNoteInfo * GRID_SIZE);
note.y = Math.floor(getYfromStrum((daStrumTime - sectionStartTime()) % (Conductor.stepCrochet * _song.notes[curSection].lengthInSteps))); note.y = Math.floor(getYfromStrum((daStrumTime - sectionStartTime()) % (Conductor.stepCrochet * _song.notes[Conductor.curNotes][curSection].lengthInSteps)));
curRenderedNotes.add(note); curRenderedNotes.add(note);
@ -1108,18 +1108,18 @@ class ChartingState extends MusicBeatState
altAnim: false altAnim: false
}; };
_song.notes.push(sec); _song.notes[Conductor.curNotes].push(sec);
} }
function selectNote(note:Note):Void function selectNote(note:Note):Void
{ {
var swagNum:Int = 0; var swagNum:Int = 0;
for (i in _song.notes[curSection].sectionNotes) for (i in _song.notes[Conductor.curNotes][curSection].sectionNotes)
{ {
if (i.strumTime == note.strumTime && i.noteData % 4 == note.noteData) if (i.strumTime == note.strumTime && i.noteData % 4 == note.noteData)
{ {
curSelectedNote = _song.notes[curSection].sectionNotes[swagNum]; curSelectedNote = _song.notes[Conductor.curNotes][curSection].sectionNotes[swagNum];
} }
swagNum += 1; swagNum += 1;
@ -1131,7 +1131,7 @@ class ChartingState extends MusicBeatState
function deleteNote(note:Note):Void function deleteNote(note:Note):Void
{ {
for (i in _song.notes[curSection].sectionNotes) for (i in _song.notes[Conductor.curNotes][curSection].sectionNotes)
{ {
if (i[0] == note.strumTime && i[1] % 4 == note.noteData) if (i[0] == note.strumTime && i[1] % 4 == note.noteData)
{ {
@ -1145,7 +1145,7 @@ class ChartingState extends MusicBeatState
FlxG.sound.play(Paths.sound('funnyNoise/funnyNoise-0' + placeIDK)); FlxG.sound.play(Paths.sound('funnyNoise/funnyNoise-0' + placeIDK));
FlxG.log.add('FOUND EVIL NUMBER'); FlxG.log.add('FOUND EVIL NUMBER');
_song.notes[curSection].sectionNotes.remove(i); _song.notes[Conductor.curNotes][curSection].sectionNotes.remove(i);
} }
} }
@ -1154,16 +1154,16 @@ class ChartingState extends MusicBeatState
function clearSection():Void function clearSection():Void
{ {
_song.notes[curSection].sectionNotes = []; _song.notes[Conductor.curNotes][curSection].sectionNotes = [];
updateGrid(); updateGrid();
} }
function clearSong():Void function clearSong():Void
{ {
for (daSection in 0..._song.notes.length) for (daSection in 0..._song.notes[Conductor.curNotes].length)
{ {
_song.notes[daSection].sectionNotes = []; _song.notes[Conductor.curNotes][daSection].sectionNotes = [];
} }
updateGrid(); updateGrid();
@ -1203,13 +1203,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)); 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); // trace('bullshit $bullshit'); // trace(Math.floor(dummyArrow.y / GRID_SIZE) * GRID_SIZE);
_song.notes[curSection].sectionNotes.push([noteStrum, noteData, noteSus, noteAlt]); _song.notes[Conductor.curNotes][curSection].sectionNotes.push([noteStrum, noteData, noteSus, noteAlt]);
curSelectedNote = _song.notes[curSection].sectionNotes[_song.notes[curSection].sectionNotes.length - 1]; curSelectedNote = _song.notes[Conductor.curNotes][curSection].sectionNotes[_song.notes[Conductor.curNotes][curSection].sectionNotes.length - 1];
if (FlxG.keys.pressed.CONTROL) if (FlxG.keys.pressed.CONTROL)
{ {
_song.notes[curSection].sectionNotes.push([noteStrum, (noteData + 4) % 8, noteSus, noteAlt]); _song.notes[Conductor.curNotes][curSection].sectionNotes.push([noteStrum, (noteData + 4) % 8, noteSus, noteAlt]);
} }
trace(noteStrum); trace(noteStrum);
@ -1236,7 +1236,7 @@ class ChartingState extends MusicBeatState
{ {
var daLength:Int = 0; var daLength:Int = 0;
for (i in _song.notes) for (i in _song.notes[Conductor.curNotes])
{ {
var swagLength = i.lengthInSteps; var swagLength = i.lengthInSteps;
@ -1258,14 +1258,14 @@ class ChartingState extends MusicBeatState
function loadLevel():Void function loadLevel():Void
{ {
trace(_song.notes); trace(_song.notes[Conductor.curNotes]);
} }
function getNotes():Array<Dynamic> function getNotes():Array<Dynamic>
{ {
var noteData:Array<Dynamic> = []; var noteData:Array<Dynamic> = [];
for (i in _song.notes) for (i in _song.notes[Conductor.curNotes])
{ {
noteData.push(i.sectionNotes); noteData.push(i.sectionNotes);
} }

View file

@ -6,7 +6,6 @@ import Song.SwagSong;
* ... * ...
* @author * @author
*/ */
typedef BPMChangeEvent = typedef BPMChangeEvent =
{ {
var stepTime:Int; var stepTime:Int;
@ -23,11 +22,11 @@ class Conductor
public static var lastSongPos:Float; public static var lastSongPos:Float;
public static var offset:Float = 0; public static var offset:Float = 0;
public static var curNotes:Int = 0;
public static var bpmChangeMap:Array<BPMChangeEvent> = []; public static var bpmChangeMap:Array<BPMChangeEvent> = [];
public function new() public function new() {}
{
}
public static function mapBPMChanges(song:SwagSong) public static function mapBPMChanges(song:SwagSong)
{ {
@ -38,9 +37,9 @@ class Conductor
var totalPos:Float = 0; var totalPos:Float = 0;
for (i in 0...song.notes.length) for (i in 0...song.notes.length)
{ {
if(song.notes[i].changeBPM && song.notes[i].bpm != curBPM) if (song.notes[Conductor.curNotes][i].changeBPM && song.notes[Conductor.curNotes][i].bpm != curBPM)
{ {
curBPM = song.notes[i].bpm; curBPM = song.notes[Conductor.curNotes][i].bpm;
var event:BPMChangeEvent = { var event:BPMChangeEvent = {
stepTime: totalSteps, stepTime: totalSteps,
songTime: totalPos, songTime: totalPos,
@ -49,7 +48,7 @@ class Conductor
bpmChangeMap.push(event); bpmChangeMap.push(event);
} }
var deltaSteps:Int = song.notes[i].lengthInSteps; var deltaSteps:Int = song.notes[Conductor.curNotes][i].lengthInSteps;
totalSteps += deltaSteps; totalSteps += deltaSteps;
totalPos += ((60 / curBPM) * 1000 / 4) * deltaSteps; totalPos += ((60 / curBPM) * 1000 / 4) * deltaSteps;
} }

View file

@ -482,7 +482,7 @@ class FreeplayState extends MusicBeatState
curDifficulty = 1; curDifficulty = 1;
}*/ }*/
PlayState.SONG = Song.loadFromJson(poop, songs[curSelected].songName.toLowerCase()); PlayState.SONG = Song.loadFromJson(poop + '-new', songs[curSelected].songName.toLowerCase());
PlayState.isStoryMode = false; PlayState.isStoryMode = false;
PlayState.storyDifficulty = curDifficulty; PlayState.storyDifficulty = curDifficulty;

View file

@ -48,8 +48,8 @@ class Note extends FlxSprite
public static var BAD_THRESHOLD:Float = 0.8; // 125ms , 8 frames public static var BAD_THRESHOLD:Float = 0.8; // 125ms , 8 frames
public static var GOOD_THRESHOLD:Float = 0.55; // 91.67ms , 5.5 frames public static var GOOD_THRESHOLD:Float = 0.55; // 91.67ms , 5.5 frames
public static var SICK_THRESHOLD:Float = 0.2; // 33.33ms , 2 frames public static var SICK_THRESHOLD:Float = 0.2; // 33.33ms , 2 frames
// anything below sick threshold is sick
// anything below sick threshold is sick
public static var arrowColors:Array<Float> = [1, 1, 1, 1]; public static var arrowColors:Array<Float> = [1, 1, 1, 1];
public function new(strumTime:Float, noteData:Int, ?prevNote:Note, ?sustainNote:Bool = false) public function new(strumTime:Float, noteData:Int, ?prevNote:Note, ?sustainNote:Bool = false)
@ -195,7 +195,7 @@ class Note extends FlxSprite
prevNote.updateHitbox(); prevNote.updateHitbox();
var scaleThing:Float = Math.round((Conductor.stepCrochet) * (0.45 * FlxMath.roundDecimal(PlayState.SONG.speed, 2))); var scaleThing:Float = Math.round((Conductor.stepCrochet) * (0.45 * FlxMath.roundDecimal(PlayState.SONG.speed[Conductor.curNotes], 2)));
// get them a LIL closer together cuz the antialiasing blurs the edges // get them a LIL closer together cuz the antialiasing blurs the edges
if (antialiasing) if (antialiasing)
scaleThing *= 1.0 + (1.0 / prevNote.frameHeight); scaleThing *= 1.0 + (1.0 / prevNote.frameHeight);

View file

@ -1573,7 +1573,7 @@ class PlayState extends MusicBeatState
var noteData:Array<SwagSection>; var noteData:Array<SwagSection>;
// NEW SHIT // NEW SHIT
noteData = SONG.notes; noteData = SONG.notes[Conductor.curNotes];
for (section in noteData) for (section in noteData)
{ {
@ -2037,9 +2037,9 @@ class PlayState extends MusicBeatState
changeSection(-1); changeSection(-1);
#end #end
if (generatedMusic && SONG.notes[Std.int(curStep / 16)] != null) if (generatedMusic && SONG.notes[Conductor.curNotes][Std.int(curStep / 16)] != null)
{ {
cameraRightSide = SONG.notes[Std.int(curStep / 16)].mustHitSection; cameraRightSide = SONG.notes[Conductor.curNotes][Std.int(curStep / 16)].mustHitSection;
cameraMovement(); cameraMovement();
} }
@ -2110,7 +2110,7 @@ class PlayState extends MusicBeatState
} }
} }
while (unspawnNotes[0] != null && unspawnNotes[0].strumTime - Conductor.songPosition < 1800 / SONG.speed) while (unspawnNotes[0] != null && unspawnNotes[0].strumTime - Conductor.songPosition < 1800 / SONG.speed[Conductor.curNotes])
{ {
var dunceNote:Note = unspawnNotes[0]; var dunceNote:Note = unspawnNotes[0];
notes.add(dunceNote); notes.add(dunceNote);
@ -2135,7 +2135,7 @@ class PlayState extends MusicBeatState
} }
var strumLineMid = strumLine.y + Note.swagWidth / 2; var strumLineMid = strumLine.y + Note.swagWidth / 2;
daNote.y = (Conductor.songPosition - daNote.strumTime) * (0.45 * FlxMath.roundDecimal(SONG.speed, 2)); daNote.y = (Conductor.songPosition - daNote.strumTime) * (0.45 * FlxMath.roundDecimal(SONG.speed[Conductor.curNotes], 2));
if (PreferencesMenu.getPref('downscroll')) if (PreferencesMenu.getPref('downscroll'))
{ {
@ -2172,9 +2172,9 @@ class PlayState extends MusicBeatState
var altAnim:String = ""; var altAnim:String = "";
if (SONG.notes[Math.floor(curStep / 16)] != null) if (SONG.notes[Conductor.curNotes][Math.floor(curStep / 16)] != null)
{ {
if (SONG.notes[Math.floor(curStep / 16)].altAnim) if (SONG.notes[Conductor.curNotes][Math.floor(curStep / 16)].altAnim)
altAnim = '-alt'; altAnim = '-alt';
} }
@ -2207,7 +2207,7 @@ class PlayState extends MusicBeatState
} }
// WIP interpolation shit? Need to fix the pause issue // WIP interpolation shit? Need to fix the pause issue
// daNote.y = (strumLine.y - (songTime - daNote.strumTime) * (0.45 * SONG.speed)); // daNote.y = (strumLine.y - (songTime - daNote.strumTime) * (0.45 * SONG.speed[Conductor.curNotes]));
// removing this so whether the note misses or not is entirely up to Note class // removing this so whether the note misses or not is entirely up to Note class
// var noteMiss:Bool = daNote.y < -daNote.height; // var noteMiss:Bool = daNote.y < -daNote.height;
@ -2291,9 +2291,9 @@ class PlayState extends MusicBeatState
var daPos:Float = 0; var daPos:Float = 0;
for (i in 0...(Std.int(curStep / 16 + sec))) for (i in 0...(Std.int(curStep / 16 + sec)))
{ {
if (SONG.notes[i].changeBPM) if (SONG.notes[Conductor.curNotes][i].changeBPM)
{ {
daBPM = SONG.notes[i].bpm; daBPM = SONG.notes[Conductor.curNotes][i].bpm;
} }
daPos += 4 * (1000 * 60 / daBPM); daPos += 4 * (1000 * 60 / daBPM);
} }
@ -3070,17 +3070,17 @@ class PlayState extends MusicBeatState
notes.sort(sortNotes, FlxSort.DESCENDING); notes.sort(sortNotes, FlxSort.DESCENDING);
} }
if (SONG.notes[Math.floor(curStep / 16)] != null) if (SONG.notes[Conductor.curNotes][Math.floor(curStep / 16)] != null)
{ {
if (SONG.notes[Math.floor(curStep / 16)].changeBPM) if (SONG.notes[Conductor.curNotes][Math.floor(curStep / 16)].changeBPM)
{ {
Conductor.changeBPM(SONG.notes[Math.floor(curStep / 16)].bpm); Conductor.changeBPM(SONG.notes[Conductor.curNotes][Math.floor(curStep / 16)].bpm);
FlxG.log.add('CHANGED BPM!'); FlxG.log.add('CHANGED BPM!');
} }
// else // else
// Conductor.changeBPM(SONG.bpm); // Conductor.changeBPM(SONG.bpm);
} }
// FlxG.log.add('change bpm' + SONG.notes[Std.int(curStep / 16)].changeBPM); // FlxG.log.add('change bpm' + SONG.notes[Conductor.curNotes][Std.int(curStep / 16)].changeBPM);
// HARDCODING FOR MILF ZOOMS! // HARDCODING FOR MILF ZOOMS!
@ -3106,9 +3106,9 @@ class PlayState extends MusicBeatState
iconP2.updateHitbox(); iconP2.updateHitbox();
if (curBeat % 8 == 7 if (curBeat % 8 == 7
&& SONG.notes[Math.floor(curStep / 16)].mustHitSection && SONG.notes[Conductor.curNotes][Math.floor(curStep / 16)].mustHitSection
&& combo > 5 && combo > 5
&& !SONG.notes[Math.floor(curStep / 16) + 1].mustHitSection) && !SONG.notes[Conductor.curNotes][Math.floor(curStep / 16) + 1].mustHitSection)
{ {
var animShit:ComboCounter = new ComboCounter(-100, 300, combo); var animShit:ComboCounter = new ComboCounter(-100, 300, combo);
animShit.scrollFactor.set(0.6, 0.6); animShit.scrollFactor.set(0.6, 0.6);

View file

@ -10,11 +10,11 @@ using StringTools;
typedef SwagSong = typedef SwagSong =
{ {
var song:String; var song:String;
var notes:Array<SwagSection>; var notes:Array<Array<SwagSection>>;
var bpm:Float; var bpm:Float;
var needsVoices:Bool; var needsVoices:Bool;
var voiceList:Array<String>; var voiceList:Array<String>;
var speed:Float; var speed:Array<Float>;
var player1:String; var player1:String;
var player2:String; var player2:String;
@ -24,7 +24,7 @@ typedef SwagSong =
class Song class Song
{ {
public var song:String; public var song:String;
public var notes:Array<SwagSection>; public var notes:Array<Array<SwagSection>>;
public var bpm:Float; public var bpm:Float;
public var needsVoices:Bool = true; public var needsVoices:Bool = true;
public var speed:Float = 1; public var speed:Float = 1;
@ -72,6 +72,8 @@ class Song
{ {
var swagShit:SwagSong = cast Json.parse(rawJson).song; var swagShit:SwagSong = cast Json.parse(rawJson).song;
swagShit.validScore = true; swagShit.validScore = true;
trace(swagShit.notes[Conductor.curNotes]);
// swagShit.notes[0] = cast Json.parse(rawJson).song.notes[Conductor.curNotes]; // by default uses
return swagShit; return swagShit;
} }
} }