Perfect holdnotes and characters in env

This commit is contained in:
entar 2025-06-05 08:44:19 +07:00
parent c729c1c0ed
commit 0380258c8f
2 changed files with 19 additions and 6 deletions

View File

@ -129,7 +129,7 @@ local function state(songName, songDifficulty)
}
local font = love.graphics.newFont("fonts/Phantomuff.ttf", 15)
local biggerFont = love.graphics.newFont("fonts/Phantomuff.ttf", 23)
local biggerFont = love.graphics.newFont("fonts/Phantomuff.ttf", 30)
local receptors = {}
local splashes = {}
@ -316,7 +316,7 @@ local function state(songName, songDifficulty)
for index, hold in next, holdNotes do
if hold.mustPress then
hold.sprite.position = myTypes.Vector2(625 + (79 * (hold.direction - 1)), settings.Downscroll and 430 - (hold.position-elapsed) * speed or (hold.position - elapsed) * speed)
if hold.position - elapsed + hold.sprite.extraOffset.y < 10 then
if hold.position - elapsed < 10 then
if love.keyboard.isDown(keyBinds[hold.direction]) then
if section.altAnim or hold.altAnim then
characters.bf:PlayAnimation("sing"..directions[hold.direction].."-alt")
@ -336,7 +336,7 @@ local function state(songName, songDifficulty)
end
else
hold.sprite.position = myTypes.Vector2(75 + (79 * (hold.direction - 1)), settings.Downscroll and 430 - (hold.position-elapsed) * speed or (hold.position - elapsed) * speed)
if hold.position - elapsed + hold.sprite.extraOffset.y < 10 then
if hold.position - elapsed < 10 then
if section.altAnim or hold.altAnim then
characters.dad:PlayAnimation("sing"..directions[hold.direction].."-alt")
else
@ -416,10 +416,22 @@ local function state(songName, songDifficulty)
modules[#modules+1] = stageModule
end
for i, func in next, stageModule do
setfenv(func, {
characters=characters,
step=step,
beat=beat,
volume=volume,
ratings=ratings,,
keyBinds=keyBinds
})
end
if stageModule and stageModule.onCreate then
stageModule.onCreate(chart.song)
end
-- GF first so she is below other chars
if chart.gfVersion ~= "none" then
characters.gf = myTypes.character(chart.gfVersion)
@ -476,17 +488,18 @@ local function state(songName, songDifficulty)
if note[3] > 0 then
local length = note[3] / conductor.stepCrochet
for i = 0, length - 1, .1 do
for i = 0, length - .1, .1 do
local newHold = myTypes.note({note[1] + i * conductor.stepCrochet, note[2], note[3], note[4]}, section.mustHitSection, true)
unspawnedHoldNotes[#unspawnedHoldNotes+1] = newHold
end
local newHold = myTypes.note({note[1] + math.floor(length) * conductor.stepCrochet, note[2], note[3], note[4]}, section.mustHitSection, true, true)
unspawnedHoldNotes[#unspawnedHoldNotes+1] = newHold
newHold.holdEnd = true
if settings.Downscroll then
newHold.flipY = true
newHold.speed = speed
end
newHold.speed = speed
end
end
end

View File

@ -37,7 +37,7 @@ function NoteClass:spawn()
if self.holdEnd then
spriteName = string.format("%s hold end", sprites[self.direction])
if self.flipY then
sprite.extraOffset = module.types.Vector2(0, -150 * self.speed * 2.5)
sprite.extraOffset = module.types.Vector2(0, -70)
end
else
spriteName = string.format("%s hold piece", sprites[self.direction])