2020-11-02 21:47:58 -06:00
|
|
|
require 'funcs'
|
|
|
|
|
|
|
|
local SurvivalA3Game = require 'tetris.modes.survival_a3'
|
|
|
|
|
|
|
|
local FourWideGame = SurvivalA3Game:extend()
|
|
|
|
|
|
|
|
FourWideGame.name = "4-wide Simulator"
|
|
|
|
FourWideGame.hash = "4wide"
|
2020-11-03 09:58:21 -06:00
|
|
|
FourWideGame.tagline = "The board has gotten narrower! Can you survive the increasing speeds?"
|
2020-11-02 21:47:58 -06:00
|
|
|
|
|
|
|
function FourWideGame:initialize(ruleset)
|
|
|
|
self.super:initialize(ruleset)
|
|
|
|
self.grid:applyFourWide()
|
|
|
|
end
|
|
|
|
|
|
|
|
local cleared_row_levels = {1, 2, 4, 6}
|
|
|
|
|
|
|
|
function FourWideGame:onLineClear(cleared_row_count)
|
|
|
|
if not self.clear then
|
|
|
|
local new_level = self.level + cleared_row_levels[cleared_row_count]
|
|
|
|
self:updateSectionTimes(self.level, new_level)
|
|
|
|
if new_level >= 1300 or self:hitTorikan(self.level, new_level) then
|
2020-11-06 19:49:44 -06:00
|
|
|
self.clear = true
|
2020-11-02 21:47:58 -06:00
|
|
|
if new_level >= 1300 then
|
|
|
|
self.level = 1300
|
2020-11-06 19:49:44 -06:00
|
|
|
self.grid:clear()
|
|
|
|
self.roll_frames = -150
|
|
|
|
else
|
|
|
|
self.game_over = true
|
2020-11-02 21:47:58 -06:00
|
|
|
end
|
|
|
|
else
|
|
|
|
self.level = math.min(new_level, 1300)
|
|
|
|
end
|
|
|
|
self:advanceBottomRow(-cleared_row_count)
|
|
|
|
end
|
|
|
|
self.grid:applyFourWide()
|
|
|
|
end
|
|
|
|
|
|
|
|
return FourWideGame
|