Skip to content

Commit

Permalink
Rewrite the last bit of note generation
Browse files Browse the repository at this point in the history
  • Loading branch information
GuglioIsStupid committed May 5, 2024
1 parent c758b51 commit 96d11d6
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 75 deletions.
57 changes: 19 additions & 38 deletions src/love/modules/deprecated.lua
Original file line number Diff line number Diff line change
Expand Up @@ -52,45 +52,26 @@ function weeks.legacyGenerateNotes(self, chart)
if settings.downscroll then noteObject.sizeY = -1 end

local enemyNote = (mustHitSection and noteType >= 4) or (not mustHitSection and noteType < 4)

if enemyNote then
noteObject.x = enemyArrows[id].x

table.insert(enemyNotes[id], noteObject)
if holdLength > 0 then
for k = 71 / speed, holdLength, 71 / speed do
local holdNote = sprites[id]()
holdNote.col = id
holdNote.y = -400 + (time + k) * 0.6 * speed
holdNote.ver = noteVer
holdNote.time = time + k
holdNote:animate("hold")

holdNote.x = enemyArrows[id].x
table.insert(enemyNotes[id], holdNote)
end

enemyNotes[id][#enemyNotes[id]]:animate("end")
end
else
noteObject.x = boyfriendArrows[id].x
table.insert(boyfriendNotes[id], noteObject)

if holdLength > 0 then
for k = 71 / speed, holdLength, 71 / speed do
local holdNote = sprites[id]()
holdNote.col = id
holdNote.y = -400 + (time + k) * 0.6 * speed
holdNote.ver = noteVer
holdNote.time = time + k
holdNote:animate("hold")

holdNote.x = boyfriendArrows[id].x
table.insert(boyfriendNotes[id], holdNote)
end

boyfriendNotes[id][#boyfriendNotes[id]]:animate("end")
local notesTable = enemyNote and enemyNotes or boyfriendNotes
local arrowsTable = enemyNote and enemyArrows or boyfriendArrows

noteObject.x = arrowsTable[id].x

table.insert(notesTable[id], noteObject)
if holdLength > 0 then
for k = 71 / speed, holdLength, 71 / speed do
local holdNote = sprites[id]()
holdNote.col = id
holdNote.y = -400 + (time + k) * 0.6 * speed
holdNote.ver = noteVer
holdNote.time = time + k
holdNote:animate("hold")

holdNote.x = arrowsTable[id].x
table.insert(notesTable[id], holdNote)
end

notesTable[id][#notesTable[id]]:animate("end")
end

::continue::
Expand Down
55 changes: 18 additions & 37 deletions src/love/states/weeks.lua
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,6 @@ return {

for _, noteData in ipairs(chart) do
local data = noteData.d % 4 + 1
local enemyNote = noteData.d > 3
local time = noteData.t
local holdTime = noteData.l or 0

Expand All @@ -431,44 +430,26 @@ return {

if settings.downscroll then noteObject.sizeY = -1 end

if enemyNote then
noteObject.x = enemyArrows[data].x
table.insert(enemyNotes[data], noteObject)

if holdTime > 0 then
for k = 71 / speed, holdTime, 71 / speed do
local holdNote = sprites[data]()
holdNote.col = data
holdNote.y = -400 + (time + k) * 0.6 * speed
holdNote.ver = noteData.k or "normal"
holdNote.time = time + k
holdNote:animate("hold")

holdNote.x = enemyArrows[data].x
table.insert(enemyNotes[data], holdNote)
end

enemyNotes[data][#enemyNotes[data]]:animate("end")
local enemyNote = noteData.d > 3
local notesTable = enemyNote and enemyNotes or boyfriendNotes
local arrowsTable = enemyNote and enemyArrows or boyfriendArrows

noteObject.x = arrowsTable[data].x
table.insert(notesTable[data], noteObject)
if holdTime > 0 then
for k = 71 / speed, holdTime, 71 / speed do
local holdNote = sprites[data]()
holdNote.col = data
holdNote.y = -400 + (time + k) * 0.6 * speed
holdNote.ver = noteData.k or "normal"
holdNote.time = time + k
holdNote:animate("hold")

holdNote.x = arrowsTable[data].x
table.insert(notesTable[data], holdNote)
end
else
noteObject.x = boyfriendArrows[data].x
table.insert(boyfriendNotes[data], noteObject)

if holdTime > 0 then
for k = 71 / speed, holdTime, 71 / speed do
local holdNote = sprites[data]()
holdNote.col = data
holdNote.y = -400 + (time + k) * 0.6 * speed
holdNote.ver = noteData.k or "normal"
holdNote.time = time + k
holdNote:animate("hold")

holdNote.x = boyfriendArrows[data].x
table.insert(boyfriendNotes[data], holdNote)
end

boyfriendNotes[data][#boyfriendNotes[data]]:animate("end")
end
notesTable[data][#notesTable[data]]:animate("end")
end
end

Expand Down

0 comments on commit 96d11d6

Please sign in to comment.