cambridge/tetris/rulesets/arika_ace2.lua

58 lines
1.1 KiB
Lua
Raw Normal View History

local Piece = require 'tetris.components.piece'
2020-12-04 19:36:11 -06:00
local Ruleset = require 'tetris.rulesets.arika_ti'
local ARS = Ruleset:extend()
2020-10-18 20:54:24 -05:00
ARS.name = "ACE-ARS2"
ARS.hash = "ArikaACE2"
ARS.spawn_positions = {
I = { x=5, y=2 },
J = { x=4, y=3 },
L = { x=4, y=3 },
O = { x=5, y=3 },
S = { x=4, y=3 },
T = { x=4, y=3 },
Z = { x=4, y=3 },
}
ARS.big_spawn_positions = {
I = { x=3, y=0 },
J = { x=2, y=1 },
L = { x=2, y=1 },
O = { x=3, y=1 },
S = { x=2, y=1 },
T = { x=2, y=1 },
Z = { x=2, y=1 },
}
function ARS:onPieceCreate(piece, grid)
piece.floorkick = 0
piece.manipulations = 0
end
function ARS:onPieceMove(piece, grid)
piece.lock_delay = 0 -- move reset
if piece:isDropBlocked(grid) then
piece.manipulations = piece.manipulations + 1
2020-11-21 20:48:45 -06:00
if piece.manipulations >= 128 then
piece.locked = true
end
end
end
function ARS:onPieceRotate(piece, grid)
piece.lock_delay = 0 -- rotate reset
if piece:isDropBlocked(grid) then
piece.manipulations = piece.manipulations + 1
2020-11-21 20:48:45 -06:00
if piece.manipulations >= 128 then
piece.locked = true
end
end
2020-11-21 20:48:45 -06:00
if piece.floorkick >= 1 then
piece.floorkick = piece.floorkick + 1
end
end
return ARS