diff --git a/tetris/modes/marathon_a2.lua b/tetris/modes/marathon_a2.lua index 7d45f49..a460890 100644 --- a/tetris/modes/marathon_a2.lua +++ b/tetris/modes/marathon_a2.lua @@ -14,8 +14,8 @@ MarathonA2Game.tagline = "The points don't matter! Can you reach the invisible r -function MarathonA2Game:new() - MarathonA2Game.super:new() +function MarathonA2Game:new(cfg) + MarathonA2Game.super:new(cfg) self.roll_frames = 0 self.combo = 1 @@ -38,8 +38,8 @@ function MarathonA2Game:new() self.additive_gravity = false self.lock_drop = false self.lock_hard_drop = false - self.enable_hold = false - self.next_queue_length = 1 + self.enable_hold = cfg.allowHold == 2 + self.next_queue_length = cfg.nextQueue == 2 and 3 or 1 end function MarathonA2Game:getARE() @@ -403,4 +403,11 @@ function MarathonA2Game:getBackground() return math.floor(self.level / 100) end +function MarathonA2Game:provideSettings() + return { + {"allowHold", "Allow hold", {"No", "Yes"}}, + {"nextQueue", "Next pieces", {"One", "Three"}} + } +end + return MarathonA2Game diff --git a/tetris/modes/survival_a2.lua b/tetris/modes/survival_a2.lua index 1ebec70..f170aee 100644 --- a/tetris/modes/survival_a2.lua +++ b/tetris/modes/survival_a2.lua @@ -14,8 +14,8 @@ SurvivalA2Game.tagline = "The game starts fast and only gets faster!" -function SurvivalA2Game:new() - SurvivalA2Game.super:new() +function SurvivalA2Game:new(cfg) + SurvivalA2Game.super:new(cfg) self.roll_frames = 0 self.combo = 1 self.randomizer = History6RollsRandomizer() @@ -28,6 +28,8 @@ function SurvivalA2Game:new() self.lock_drop = true self.lock_hard_drop = true + self.enable_hold = cfg.allowHold == 2 + self.next_queue_length = cfg.nextQueue == 2 and 3 or 1 end function SurvivalA2Game:getARE() @@ -185,4 +187,11 @@ function SurvivalA2Game:getHighscoreData() } end +function SurvivalA2Game:provideSettings() + return { + {"allowHold", "Allow hold", {"No", "Yes"}}, + {"nextQueue", "Next pieces", {"One", "Three"}} + } +end + return SurvivalA2Game