Added T-Spin Triple rotation (no detection, yet)

This commit is contained in:
LDDestroier 2019-10-22 02:17:47 -04:00 committed by GitHub
parent a5e0d08f72
commit 9497203bf2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -283,6 +283,12 @@ local makeNewMino = function(minoType, board, x, y, replaceColor)
mino.shape = output
-- try to kick off wall/floor
if mino.checkCollision(0, 0) then
-- try T-spin triple rotation
if not mino.checkCollision(-direction, 2) then
mino.y = mino.y + 2
mino.x = mino.x - direction
return true
end
-- kick off floor
for y = 1, math.floor(#mino.shape) do
if not mino.checkCollision(0, -y) then