From 296e90481d65dc83fd7e6e525a47609f703bae38 Mon Sep 17 00:00:00 2001 From: TheZoroForce240 <86524550+TheZoroForce240@users.noreply.github.com> Date: Wed, 28 Aug 2024 11:37:11 +0100 Subject: [PATCH] pixel note fixes for scale/mulitkey --- assets/data/scripts/pixel.hx | 20 ++++++++++++-------- source/funkin/game/Strum.hx | 4 ++-- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/assets/data/scripts/pixel.hx b/assets/data/scripts/pixel.hx index cc8239cf..d2ab6e8f 100644 --- a/assets/data/scripts/pixel.hx +++ b/assets/data/scripts/pixel.hx @@ -23,15 +23,17 @@ function onNoteCreation(event) { event.cancel(); var note = event.note; + var strumID = event.strumID % 4; if (event.note.isSustainNote) { note.loadGraphic(Paths.image('stages/school/ui/arrowEnds'), true, 7, 6); - note.animation.add("hold", [event.strumID]); - note.animation.add("holdend", [4 + event.strumID]); + note.animation.add("hold", [strumID]); + note.animation.add("holdend", [4 + strumID]); } else { note.loadGraphic(Paths.image('stages/school/ui/arrows-pixels'), true, 17, 17); - note.animation.add("scroll", [4 + event.strumID]); + note.animation.add("scroll", [4 + strumID]); } - note.scale.set(daPixelZoom, daPixelZoom); + var strumScale = event.note.strumLine.strumScale; + note.scale.set(daPixelZoom*strumScale, daPixelZoom*strumScale); note.updateHitbox(); } @@ -48,12 +50,14 @@ function onStrumCreation(event) { event.cancel(); var strum = event.strum; + var strumID = event.strumID % 4; strum.loadGraphic(Paths.image('stages/school/ui/arrows-pixels'), true, 17, 17); - strum.animation.add("static", [event.strumID]); - strum.animation.add("pressed", [4 + event.strumID, 8 + event.strumID], 12, false); - strum.animation.add("confirm", [12 + event.strumID, 16 + event.strumID], 24, false); + strum.animation.add("static", [strumID]); + strum.animation.add("pressed", [4 + strumID, 8 + strumID], 12, false); + strum.animation.add("confirm", [12 + strumID, 16 + strumID], 24, false); - strum.scale.set(daPixelZoom, daPixelZoom); + var strumScale = strumLines.members[event.player].strumScale; + strum.scale.set(daPixelZoom*strumScale, daPixelZoom*strumScale); strum.updateHitbox(); } diff --git a/source/funkin/game/Strum.hx b/source/funkin/game/Strum.hx index e765264b..b411cf5b 100644 --- a/source/funkin/game/Strum.hx +++ b/source/funkin/game/Strum.hx @@ -98,12 +98,12 @@ class Strum extends FlxSprite { private inline function updateNotePos(daNote:Note) { if (daNote.strumRelativePos) { daNote.setPosition((this.width - daNote.width) / 2, (daNote.strumTime - Conductor.songPosition) * (0.45 * CoolUtil.quantize(getScrollSpeed(daNote), 100))); - if (daNote.isSustainNote) daNote.y += N_WIDTHDIV2 * (scale.y / 0.7); + if (daNote.isSustainNote) daNote.y += N_WIDTHDIV2 * (height / 112); } else { var offset = FlxPoint.get(0, (Conductor.songPosition - daNote.strumTime) * (0.45 * CoolUtil.quantize(getScrollSpeed(daNote), 100))); var realOffset = FlxPoint.get(0, 0); - if (daNote.isSustainNote) offset.y -= N_WIDTHDIV2 * (scale.y / 0.7); + if (daNote.isSustainNote) offset.y -= N_WIDTHDIV2 * (height / 112); if (Std.int(daNote.__noteAngle % 360) != 0) { var noteAngleCos = FlxMath.fastCos(daNote.__noteAngle / PIX180);