SRS now has upgraded 180s

This commit is contained in:
Ishaan Bhardwaj
2021-01-30 16:49:52 -05:00
parent fa2fe77081
commit 5e02471fb4
3 changed files with 25 additions and 14 deletions

View File

@@ -10,6 +10,17 @@ SRS.harddrop_lock = true
SRS.MANIPULATIONS_MAX = 15
function SRS:checkNewLow(piece)
for _, block in pairs(piece:getBlockOffsets()) do
local y = piece.position.y + block.y
if y > piece.lowest_y then
piece.manipulations = 0
piece.rotations = 0
piece.lowest_y = y
end
end
end
function SRS:onPieceDrop(piece, grid)
self:checkNewLow(piece)
if piece.manipulations >= self.MANIPULATIONS_MAX and piece:isDropBlocked(grid) then