From dc11504c2508a9227b411ed82eeb9ba1fcdcf5d7 Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Tue, 13 Oct 2020 02:55:00 -0700 Subject: [PATCH] so close to proper note reading... --- source/ChartingState.hx | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/source/ChartingState.hx b/source/ChartingState.hx index 369450ce8..b9d9e21c7 100644 --- a/source/ChartingState.hx +++ b/source/ChartingState.hx @@ -138,7 +138,7 @@ class ChartingState extends MusicBeatState { Conductor.songPosition = FlxG.sound.music.time; - strumLine.y = getYfromStrum(Conductor.songPosition % (Conductor.stepCrochet * 16), false); + strumLine.y = getYfromStrum(Conductor.songPosition % (Conductor.stepCrochet * 16)); if (curBeat % 4 == 0) { @@ -243,7 +243,7 @@ class ChartingState extends MusicBeatState note.setGraphicSize(GRID_SIZE, GRID_SIZE); note.updateHitbox(); note.x = Math.floor(i[1] * GRID_SIZE); - note.y = getYfromStrum(note.strumTime) % (Conductor.stepCrochet * sections[curSection].lengthInSteps); + note.y = getYfromStrum(note.strumTime) % gridBG.height; curRenderedNotes.add(note); } @@ -257,9 +257,13 @@ class ChartingState extends MusicBeatState private function addNote():Void { sections[curSection].notes.push([ - getStrumTime(dummyArrow.y) * FlxMath.maxInt(curSection, 1), + getStrumTime(dummyArrow.y) + (curSection * (Conductor.stepCrochet * 16)), Math.floor(FlxG.mouse.x / GRID_SIZE) ]); + + trace(getStrumTime(dummyArrow.y) + (curSection * (Conductor.stepCrochet * 16))); + trace(curSection); + updateGrid(); } @@ -268,15 +272,9 @@ class ChartingState extends MusicBeatState return FlxMath.remapToRange(yPos, gridBG.y, gridBG.y + gridBG.height, 0, 16 * Conductor.stepCrochet); } - function getYfromStrum(strumTime:Float, ?isNote:Bool = true):Float + function getYfromStrum(strumTime:Float):Float { - var strumShit:Float = 0; - if (isNote) - strumShit = FlxMath.remapToRange(strumTime, 0, (16 * Conductor.stepCrochet) * FlxMath.maxInt(curSection, 1), gridBG.y, gridBG.y + gridBG.height); - else - strumShit = FlxMath.remapToRange(strumTime, 0, 16 * Conductor.stepCrochet, gridBG.y, gridBG.y + gridBG.height); - - return strumShit; + return FlxMath.remapToRange(strumTime, 0, 16 * Conductor.stepCrochet, gridBG.y, gridBG.y + gridBG.height); } private var daSpacing:Float = 0.3;