Fixing step reset

pull/3/head
Ishaan Bhardwaj 2020-10-11 15:41:56 -04:00
parent eddfee566d
commit 0c317d9ce1
4 changed files with 9 additions and 6 deletions

View File

@ -150,6 +150,7 @@ end
function ARS:onPieceDrop(piece, grid)
piece.lock_delay = 0 -- step reset
piece.manipulations = 0
end
function ARS:onPieceMove(piece, grid)

View File

@ -164,6 +164,7 @@ end
function SRS:onPieceDrop(piece, grid)
piece.lock_delay = 0 -- step reset
piece.manipulations = 0
end
function SRS:onPieceMove(piece, grid)

View File

@ -159,19 +159,19 @@ function SRS:attemptWallkicks(piece, new_piece, rot_dir, grid)
end
function SRS:onPieceCreate(piece, grid)
piece.rotate_counter = 0
piece.move_counter = 0
piece.manipulations = 0
end
function SRS:onPieceDrop(piece, grid)
piece.lock_delay = 0 -- step reset
piece.manipulations = 0
end
function SRS:onPieceMove(piece, grid)
piece.lock_delay = 0 -- move reset
if piece:isDropBlocked(grid) then
piece.move_counter = piece.move_counter + 1
if piece.move_counter >= 24 then
piece.manipulations = piece.manipulations + 1
if piece.manipulations >= 15 then
piece.locked = true
end
end
@ -180,8 +180,8 @@ end
function SRS:onPieceRotate(piece, grid)
piece.lock_delay = 0 -- rotate reset
if piece:isDropBlocked(grid) then
piece.rotate_counter = piece.rotate_counter + 1
if piece.rotate_counter >= 12 then
piece.manipulations = piece.manipulations + 1
if piece.manipulations >= 15 then
piece.locked = true
end
end

View File

@ -164,6 +164,7 @@ end
function SRS:onPieceDrop(piece, grid)
piece.lock_delay = 0 -- step reset
piece.manipulations = 0
end
function SRS:onPieceMove(piece, grid)