Skip to content

Commit

Permalink
Fix weekend1 from crashing, fix countdown, fix hold covers
Browse files Browse the repository at this point in the history
  • Loading branch information
GuglioIsStupid committed May 16, 2024
1 parent 0103fdc commit 983e6dc
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/love/modules/Cover.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,14 @@ function cover:update(dt)
end
end

function cover:getVisibility(id, plr)
return self.covers[plr][id].hiding
end

-- 1 = boyfriend, 2 = enemy
function cover:show(id, plr)
if not self.covers[plr][id].visible then
self.covers[plr][id].hiding = false
self.covers[plr][id].visible = true
self.covers[plr][id]:animate(CONSTANTS.WEEKS.NOTE_LIST[id] .. " start", false, function()
self.covers[plr][id]:animate(CONSTANTS.WEEKS.NOTE_LIST[id], true)
Expand All @@ -45,6 +50,7 @@ function cover:show(id, plr)
end

function cover:hide(id, plr)
self.covers[plr][id].hiding = true
self.covers[plr][id]:animate(CONSTANTS.WEEKS.NOTE_LIST[id] .. " end", false, function()
self.covers[plr][id].visible = false
end)
Expand Down
10 changes: 9 additions & 1 deletion src/love/states/weeks.lua
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,8 @@ return {
if not stepCrochet then stepCrochet = crochet / 4 end
end

if not bpm then bpm = 120 end

local sprites = {
sprites.leftArrow,
sprites.downArrow,
Expand Down Expand Up @@ -486,7 +488,9 @@ return {
setupCountdown = function(self, countNumVal)
local countNumVal = countNumVal or 4
lastReportedPlaytime = 0
musicTime = ((60*4) / bpm) * -1000 -- countdown is 4 beats long
if countNumVal == 4 then
musicTime = ((60*4) / bpm) * -1000 -- countdown is 4 beats long
end
musicThres = 0

countingDown = true
Expand Down Expand Up @@ -1042,6 +1046,10 @@ return {
table.remove(boyfriendNote, 1)
end

if not input:down(curInput) and not HoldCover:getVisibility(i, 1) then
HoldCover:hide(i, 1)
end

if input:released(curInput) then
boyfriendArrow:animate(CONSTANTS.WEEKS.NOTE_LIST[i], false)
end
Expand Down
2 changes: 1 addition & 1 deletion src/love/weeks/weekend1.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ return {

stages["streets"]:enter()

song = 5
song = songNum
difficulty = songAppend
erectMode = isErect

Expand Down

0 comments on commit 983e6dc

Please sign in to comment.