Reorganized the ruleset names and added ARS-X.

Also, the ruleset inheritance was a little wonky, so I changed that too.
In particular, I made SRS-X always spawn in-frame since that was always
supposed to be how it worked.
This commit is contained in:
Joe Zeng
2022-10-24 20:09:08 -04:00
parent decc1f563f
commit 323c457809
5 changed files with 59 additions and 6 deletions

View File

@@ -1,5 +1,5 @@
local Piece = require 'tetris.components.piece'
local Ruleset = require 'tetris.rulesets.standard_exp'
local Ruleset = require 'tetris.rulesets.standard_ace'
local SRS = Ruleset:extend()
@@ -33,8 +33,8 @@ SRS.wallkicks_line = {
},
};
function SRS:attemptWallkicks(piece, new_piece, rot_dir, grid)
function SRS:attemptWallkicks(piece, new_piece, rot_dir, grid)
local kicks
if piece.shape == "O" then
return
@@ -69,6 +69,12 @@ function SRS:checkNewLow(piece)
end
end
function SRS:onPieceCreate(piece, grid)
piece.manipulations = 0
piece.rotations = 0
piece.lowest_y = -math.huge
end
function SRS:onPieceDrop(piece, grid)
self:checkNewLow(piece)
if piece.manipulations >= self.MANIPULATIONS_MAX and piece:isDropBlocked(grid) then