Merge pull request #56 from Kirby703/patch-8

added cool+regret colors to splits
This commit is contained in:
Ishaan Bhardwaj 2023-07-01 22:20:52 -04:00 committed by GitHub
commit 3f789210a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -41,6 +41,7 @@ function PhantomMania2Game:new()
self.coolregret_message = ""
self.coolregret_timer = 0
self.coolregrets = { [0] = 0 }
end
function PhantomMania2Game:getARE()
@ -219,11 +220,14 @@ function PhantomMania2Game:updateSectionTimes(old_level, new_level)
self.section_start_time = self.frames
if section_time <= cool_cutoffs[section] then
self.grade = self.grade + 2
table.insert(self.coolregrets, 2)
self.coolregret_message = "COOL!!"
self.coolregret_timer = 300
elseif section_time <= regret_cutoffs[section] then
self.grade = self.grade + 1
table.insert(self.coolregrets, 1)
else
table.insert(self.coolregrets, 0)
self.coolregret_message = "REGRET!!"
self.coolregret_timer = 300
end
@ -292,6 +296,16 @@ function PhantomMania2Game:setHoldOpacity()
end
end
function PhantomMania2Game:sectionColourFunction(section)
if self.coolregrets[section] == 2 then
return { 0, 1, 0, 1 }
elseif self.coolregrets[section] == 0 then
return { 1, 0, 0, 1 }
else
return { 1, 1, 1, 1 }
end
end
function PhantomMania2Game:drawScoringInfo()
PhantomMania2Game.super.drawScoringInfo(self)