mirror of
https://github.com/SashLilac/cambridge.git
synced 2025-05-13 20:21:25 -05:00
Ruleset and randomizer refactoring (Read comments)
You can now specify an arbitrary number of pieces for a ruleset. The randomizers will adjust accordingly. Expect a pento ruleset in the modpack soon! Also, gamemode skin selection has been refactored.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
local Object = require 'libs.classic'
|
||||
local Piece = require 'tetris.components.piece'
|
||||
local Bag7Randomizer = require "tetris.randomizers.bag7"
|
||||
|
||||
local Ruleset = Object:extend()
|
||||
|
||||
@@ -22,10 +23,24 @@ Ruleset.harddrop_lock = false
|
||||
|
||||
Ruleset.enable_IRS_wallkicks = false
|
||||
Ruleset.are_cancel = false
|
||||
Ruleset.fallback_randomizer = Bag7Randomizer()
|
||||
|
||||
Ruleset.next_sounds = {
|
||||
I = "I",
|
||||
L = "L",
|
||||
J = "J",
|
||||
S = "S",
|
||||
Z = "Z",
|
||||
O = "O",
|
||||
T = "T"
|
||||
}
|
||||
|
||||
Ruleset.pieces = 7
|
||||
|
||||
-- Component functions.
|
||||
|
||||
function Ruleset:new()
|
||||
|
||||
if config.gamesettings.piece_colour == 1 then
|
||||
blocks["bone"] = (not self.world) and
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user