mirror of
https://github.com/SashLilac/cambridge.git
synced 2024-11-22 17:59:01 -06:00
Fixed Marathon A3 section times, read comments
Some modes may not launch currently, will fix
This commit is contained in:
parent
70a827b477
commit
452879ebab
@ -109,7 +109,6 @@ end
|
|||||||
|
|
||||||
function GameMode:update(inputs, ruleset)
|
function GameMode:update(inputs, ruleset)
|
||||||
if self.game_over or self.completed then
|
if self.game_over or self.completed then
|
||||||
switchBGM(nil)
|
|
||||||
self.game_over_frames = self.game_over_frames + 1
|
self.game_over_frames = self.game_over_frames + 1
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
@ -282,6 +281,7 @@ function GameMode:onHardDrop(dropped_row_count)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function GameMode:onGameOver()
|
function GameMode:onGameOver()
|
||||||
|
switchBGM(nil)
|
||||||
love.graphics.setColor(0, 0, 0, 1 - 2 ^ (-self.game_over_frames / 30))
|
love.graphics.setColor(0, 0, 0, 1 - 2 ^ (-self.game_over_frames / 30))
|
||||||
love.graphics.rectangle(
|
love.graphics.rectangle(
|
||||||
"fill", 64, 80,
|
"fill", 64, 80,
|
||||||
@ -602,7 +602,7 @@ function GameMode:sectionColourFunction(section)
|
|||||||
return { 1, 1, 1, 1 }
|
return { 1, 1, 1, 1 }
|
||||||
end
|
end
|
||||||
|
|
||||||
function GameMode:drawSectionTimesWithSecondary(current_section)
|
function GameMode:drawSectionTimesWithSecondary(current_section, section_limit)
|
||||||
local section_x = 530
|
local section_x = 530
|
||||||
local section_secondary_x = 440
|
local section_secondary_x = 440
|
||||||
|
|
||||||
@ -627,8 +627,10 @@ function GameMode:drawSectionTimesWithSecondary(current_section)
|
|||||||
current_x = section_secondary_x
|
current_x = section_secondary_x
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if current_section <= section_limit then
|
||||||
love.graphics.printf(formatTime(self.frames - self.section_start_time), current_x, 40 + 20 * current_section, 90, "left")
|
love.graphics.printf(formatTime(self.frames - self.section_start_time), current_x, 40 + 20 * current_section, 90, "left")
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function GameMode:drawSectionTimesWithSplits(current_section)
|
function GameMode:drawSectionTimesWithSplits(current_section)
|
||||||
local section_x = 440
|
local section_x = 440
|
||||||
|
@ -30,6 +30,7 @@ function MarathonA3Game:new()
|
|||||||
self.secondary_section_times = { [0] = 0 }
|
self.secondary_section_times = { [0] = 0 }
|
||||||
self.section_times = { [0] = 0 }
|
self.section_times = { [0] = 0 }
|
||||||
self.section_cool = false
|
self.section_cool = false
|
||||||
|
self.piece_active_time = 0
|
||||||
|
|
||||||
self.randomizer = History6RollsRandomizer()
|
self.randomizer = History6RollsRandomizer()
|
||||||
|
|
||||||
@ -147,7 +148,12 @@ function MarathonA3Game:advanceOneFrame()
|
|||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function MarathonA3Game:whilePieceActive()
|
||||||
|
self.piece_active_time = self.piece_active_time + 1
|
||||||
|
end
|
||||||
|
|
||||||
function MarathonA3Game:onPieceEnter()
|
function MarathonA3Game:onPieceEnter()
|
||||||
|
self.piece_active_time = 0
|
||||||
if (self.level % 100 ~= 99) and self.level ~= 998 and self.frames ~= 0 then
|
if (self.level % 100 ~= 99) and self.level ~= 998 and self.frames ~= 0 then
|
||||||
self:updateSectionTimes(self.level, self.level + 1)
|
self:updateSectionTimes(self.level, self.level + 1)
|
||||||
self.level = self.level + 1
|
self.level = self.level + 1
|
||||||
@ -315,7 +321,7 @@ local grade_conversion = {
|
|||||||
|
|
||||||
function MarathonA3Game:updateGrade(cleared_lines)
|
function MarathonA3Game:updateGrade(cleared_lines)
|
||||||
if cleared_lines == 0 then
|
if cleared_lines == 0 then
|
||||||
self.grade_point_decay_counter = self.grade_point_decay_counter + 1
|
self.grade_point_decay_counter = self.grade_point_decay_counter + self.piece_active_time
|
||||||
if self.grade_point_decay_counter >= grade_point_decays[self.grade + 1] then
|
if self.grade_point_decay_counter >= grade_point_decays[self.grade + 1] then
|
||||||
self.grade_point_decay_counter = 0
|
self.grade_point_decay_counter = 0
|
||||||
self.grade_points = math.max(0, self.grade_points - 1)
|
self.grade_points = math.max(0, self.grade_points - 1)
|
||||||
@ -424,8 +430,8 @@ function MarathonA3Game:drawScoringInfo()
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- draw section time data
|
-- draw section time data
|
||||||
current_section = math.floor(self.level / 100) + 1
|
current_section = self.level >= 999 and 11 or math.floor(self.level / 100) + 1
|
||||||
self:drawSectionTimesWithSecondary(current_section)
|
self:drawSectionTimesWithSecondary(current_section, 10)
|
||||||
--[[
|
--[[
|
||||||
|
|
||||||
section_x = 530
|
section_x = 530
|
||||||
|
Loading…
Reference in New Issue
Block a user