Replay system v3 + love.math.random migration

This commit is contained in:
Ishaan Bhardwaj
2021-12-08 21:23:00 -05:00
parent 9b41e56135
commit 89c7205347
11 changed files with 50 additions and 44 deletions

View File

@@ -10,11 +10,11 @@ end
function History6RollsRandomizer:generatePiece()
if self.first then
self.first = false
return self:updateHistory(({"L", "J", "I", "T"})[math.random(4)])
return self:updateHistory(({"L", "J", "I", "T"})[love.math.random(4)])
else
local shapes = {"I", "J", "L", "O", "S", "T", "Z"}
for i = 1, 6 do
local x = math.random(7)
local x = love.math.random(7)
if not inHistory(shapes[x], self.history) or i == 6 then
return self:updateHistory(shapes[x])
end