mirror of
https://github.com/ninjamuffin99/Funkin.git
synced 2024-12-28 15:57:42 +00:00
sustain note scaling FIXED (imo)
clipping is still wack. also i made it round instead of floor for the number of sus notes to place because that also just makes sense imo thanks to @cuckydev again for good ideas
This commit is contained in:
parent
c9f31226e6
commit
00ec466c76
|
@ -186,9 +186,14 @@ class Note extends FlxSprite
|
|||
prevNote.animation.play('redhold');
|
||||
}
|
||||
|
||||
prevNote.scale.y *= Conductor.stepCrochet / 100 * 1.5 * PlayState.SONG.speed;
|
||||
prevNote.updateHitbox();
|
||||
// prevNote.setGraphicSize();
|
||||
|
||||
var scaleThing:Float = Math.round((Conductor.stepCrochet) * (0.45 * FlxMath.roundDecimal(PlayState.SONG.speed, 2)));
|
||||
// get them a LIL closer together cuz the antialiasing blurs the edges
|
||||
if (antialiasing)
|
||||
scaleThing *= 1.0 + (1.0 / prevNote.frameHeight);
|
||||
prevNote.scale.y = scaleThing / prevNote.frameHeight;
|
||||
prevNote.updateHitbox();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1623,7 +1623,7 @@ class PlayState extends MusicBeatState
|
|||
susLength = susLength / Conductor.stepCrochet;
|
||||
unspawnNotes.push(swagNote);
|
||||
|
||||
for (susNote in 0...Math.floor(susLength))
|
||||
for (susNote in 0...Math.round(susLength))
|
||||
{
|
||||
oldNote = unspawnNotes[Std.int(unspawnNotes.length - 1)];
|
||||
|
||||
|
@ -2118,11 +2118,11 @@ class PlayState extends MusicBeatState
|
|||
}
|
||||
|
||||
var strumLineMid = strumLine.y + Note.swagWidth / 2;
|
||||
daNote.y = (Conductor.songPosition - daNote.strumTime) * (0.45 * FlxMath.roundDecimal(SONG.speed, 2));
|
||||
|
||||
if (PreferencesMenu.getPref('downscroll'))
|
||||
{
|
||||
daNote.y = (strumLine.y + (Conductor.songPosition - daNote.strumTime) * (0.45 * FlxMath.roundDecimal(SONG.speed, 2)));
|
||||
|
||||
daNote.y += strumLine.y;
|
||||
if (daNote.isSustainNote)
|
||||
{
|
||||
if (daNote.animation.curAnim.name.endsWith("end") && daNote.prevNote != null)
|
||||
|
@ -2133,28 +2133,18 @@ class PlayState extends MusicBeatState
|
|||
if ((!daNote.mustPress || (daNote.wasGoodHit || (daNote.prevNote.wasGoodHit && !daNote.canBeHit)))
|
||||
&& daNote.y - daNote.offset.y * daNote.scale.y + daNote.height >= strumLineMid)
|
||||
{
|
||||
// clipRect is applied to graphic itself so use frame Heights
|
||||
var swagRect:FlxRect = new FlxRect(0, 0, daNote.frameWidth, daNote.frameHeight);
|
||||
|
||||
swagRect.height = (strumLineMid - daNote.y) / daNote.scale.y;
|
||||
swagRect.y = daNote.frameHeight - swagRect.height;
|
||||
daNote.clipRect = swagRect;
|
||||
applyClipRect(daNote);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
daNote.y = (strumLine.y - (Conductor.songPosition - daNote.strumTime) * (0.45 * FlxMath.roundDecimal(SONG.speed, 2)));
|
||||
|
||||
daNote.y = strumLine.y - daNote.y;
|
||||
if (daNote.isSustainNote
|
||||
&& (!daNote.mustPress || (daNote.wasGoodHit || (daNote.prevNote.wasGoodHit && !daNote.canBeHit)))
|
||||
&& daNote.y + daNote.offset.y * daNote.scale.y <= strumLineMid)
|
||||
{
|
||||
var swagRect:FlxRect = new FlxRect(0, 0, daNote.width / daNote.scale.x, daNote.height / daNote.scale.y);
|
||||
|
||||
swagRect.y = (strumLineMid - daNote.y) / daNote.scale.y;
|
||||
swagRect.height -= swagRect.y;
|
||||
daNote.clipRect = swagRect;
|
||||
applyClipRect(daNote);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2241,6 +2231,26 @@ class PlayState extends MusicBeatState
|
|||
keyShit();
|
||||
}
|
||||
|
||||
function applyClipRect(daNote:Note):Void
|
||||
{
|
||||
// clipRect is applied to graphic itself so use frame Heights
|
||||
var swagRect:FlxRect = new FlxRect(0, 0, daNote.frameWidth, daNote.frameHeight);
|
||||
var strumLineMid = strumLine.y + Note.swagWidth / 2;
|
||||
|
||||
if (PreferencesMenu.getPref('downscroll'))
|
||||
{
|
||||
swagRect.height = (strumLineMid - daNote.y) / daNote.scale.y;
|
||||
swagRect.y = daNote.frameHeight - swagRect.height;
|
||||
}
|
||||
else
|
||||
{
|
||||
swagRect.y = (strumLineMid - daNote.y) / daNote.scale.y;
|
||||
swagRect.height -= swagRect.y;
|
||||
}
|
||||
|
||||
daNote.clipRect = swagRect;
|
||||
}
|
||||
|
||||
function killCombo():Void
|
||||
{
|
||||
if (combo > 5 && gf.animOffsets.exists('sad'))
|
||||
|
|
Loading…
Reference in a new issue