mirror of
https://github.com/SashLilac/cambridge-modpack.git
synced 2024-11-22 17:49:02 -06:00
Width update
This commit is contained in:
parent
e67f431478
commit
750cb2621d
@ -1,6 +1,8 @@
|
|||||||
require 'funcs'
|
require 'funcs'
|
||||||
|
|
||||||
|
local GameMode = require 'tetris.modes.gamemode'
|
||||||
local SurvivalA3Game = require 'tetris.modes.survival_a3'
|
local SurvivalA3Game = require 'tetris.modes.survival_a3'
|
||||||
|
local Grid = require 'tetris.components.grid'
|
||||||
|
|
||||||
local FourWideGame = SurvivalA3Game:extend()
|
local FourWideGame = SurvivalA3Game:extend()
|
||||||
|
|
||||||
@ -10,30 +12,56 @@ FourWideGame.tagline = "The board has gotten narrower! Can you survive the incre
|
|||||||
|
|
||||||
function FourWideGame:initialize(ruleset)
|
function FourWideGame:initialize(ruleset)
|
||||||
self.super:initialize(ruleset)
|
self.super:initialize(ruleset)
|
||||||
self.grid:applyFourWide()
|
self.grid = Grid(4)
|
||||||
end
|
end
|
||||||
|
|
||||||
local cleared_row_levels = {1, 2, 4, 6}
|
local function getLetterGrade(grade)
|
||||||
|
if grade == 0 then
|
||||||
|
return "1"
|
||||||
|
else
|
||||||
|
return "S" .. tostring(grade)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function FourWideGame:onLineClear(cleared_row_count)
|
function FourWideGame:drawScoringInfo()
|
||||||
if not self.clear then
|
GameMode:drawScoringInfo()
|
||||||
local new_level = self.level + cleared_row_levels[cleared_row_count]
|
|
||||||
self:updateSectionTimes(self.level, new_level)
|
love.graphics.setColor(1, 1, 1, 1)
|
||||||
if new_level >= 1300 or self:hitTorikan(self.level, new_level) then
|
|
||||||
self.clear = true
|
local text_x = 160
|
||||||
if new_level >= 1300 then
|
|
||||||
self.level = 1300
|
love.graphics.setFont(font_3x5_2)
|
||||||
self.grid:clear()
|
love.graphics.printf("GRADE", text_x, 120, 40, "left")
|
||||||
self.roll_frames = -150
|
love.graphics.printf("SCORE", text_x, 200, 40, "left")
|
||||||
|
love.graphics.printf("LEVEL", text_x, 320, 40, "left")
|
||||||
|
local sg = self.grid:checkSecretGrade()
|
||||||
|
if sg >= 5 then
|
||||||
|
love.graphics.printf("SECRET GRADE", 240, 430, 180, "left")
|
||||||
|
end
|
||||||
|
|
||||||
|
if(self.coolregret_timer > 0) then
|
||||||
|
love.graphics.printf(self.coolregret_message, 64, 400, 160, "center")
|
||||||
|
self.coolregret_timer = self.coolregret_timer - 1
|
||||||
|
end
|
||||||
|
|
||||||
|
local current_section = math.floor(self.level / 100) + 1
|
||||||
|
self:drawSectionTimesWithSplits(current_section)
|
||||||
|
|
||||||
|
love.graphics.setFont(font_3x5_3)
|
||||||
|
if self.roll_frames > 3238 then love.graphics.setColor(1, 0.5, 0, 1)
|
||||||
|
elseif self.level >= 1300 and self.clear then love.graphics.setColor(0, 1, 0, 1) end
|
||||||
|
love.graphics.printf(getLetterGrade(math.floor(self.grade)), text_x, 140, 90, "left")
|
||||||
|
love.graphics.setColor(1, 1, 1, 1)
|
||||||
|
love.graphics.printf(self.score, text_x, 220, 90, "left")
|
||||||
|
love.graphics.printf(self.level, text_x, 340, 50, "right")
|
||||||
|
if self.clear then
|
||||||
|
love.graphics.printf(self.level, text_x, 370, 50, "right")
|
||||||
else
|
else
|
||||||
self.game_over = true
|
love.graphics.printf(math.floor(self.level / 100 + 1) * 100, text_x, 370, 50, "right")
|
||||||
end
|
end
|
||||||
else
|
if sg >= 5 then
|
||||||
self.level = math.min(new_level, 1300)
|
love.graphics.printf(self.SGnames[sg], 240, 450, 180, "left")
|
||||||
end
|
end
|
||||||
self:advanceBottomRow(-cleared_row_count)
|
|
||||||
end
|
|
||||||
self.grid:applyFourWide()
|
|
||||||
end
|
end
|
||||||
|
|
||||||
return FourWideGame
|
return FourWideGame
|
||||||
|
@ -37,4 +37,15 @@ function BigMemeGame:onLineClear(cleared_row_count)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function BigMemeGame:advanceBottomRow(dx)
|
||||||
|
if self.level >= 500 and self.level < 1000 then
|
||||||
|
self.garbage = math.max(self.garbage + dx, 0)
|
||||||
|
if self.garbage >= self:getGarbageLimit() then
|
||||||
|
self.grid:copyBottomRow()
|
||||||
|
self.grid:copyBottomRow()
|
||||||
|
self.garbage = 0
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
return BigMemeGame
|
return BigMemeGame
|
Loading…
Reference in New Issue
Block a user