From 8fef7faa6a770ca989e24de84f2b5c2bcaadddc9 Mon Sep 17 00:00:00 2001 From: Oshisaure Date: Tue, 6 Oct 2020 21:10:15 +0100 Subject: [PATCH] Fixed randomiser and next queue whhhackiness --- tetris/modes/gamemode.lua | 7 ------- tetris/randomizers/randomizer.lua | 7 +------ 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/tetris/modes/gamemode.lua b/tetris/modes/gamemode.lua index 565a41b..d93900c 100644 --- a/tetris/modes/gamemode.lua +++ b/tetris/modes/gamemode.lua @@ -50,13 +50,6 @@ function GameMode:new() self.secondary_section_times = { [0] = 0 } end -function GameMode:initialize() - -- after all the variables are initialized, run initialization procedures - for i = 1, self.next_queue_length do - table.insert(self.next_queue, self:getNextPiece(ruleset)) - end -end - function GameMode:getARR() return 1 end function GameMode:getDropSpeed() return 1 end function GameMode:getARE() return 25 end diff --git a/tetris/randomizers/randomizer.lua b/tetris/randomizers/randomizer.lua index 7fc40f9..48c274b 100644 --- a/tetris/randomizers/randomizer.lua +++ b/tetris/randomizers/randomizer.lua @@ -4,15 +4,10 @@ local Randomizer = Object:extend() function Randomizer:new() self:initialize() - self.next_queue = {} - for i = 1, 30 do - table.insert(self.next_queue, self:generatePiece()) - end end function Randomizer:nextPiece() - table.insert(self.next_queue, self:generatePiece()) - return table.remove(self.next_queue, 1) + return self:generatePiece() end function Randomizer:initialize()