Skip to content

Commit 9f30237

Browse files
committed
Changed how big piece with half block movement spawns
This change affects the resulting hash of _every single_ mode and ruleset
1 parent 495054a commit 9f30237

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

tetris/modes/big_a1.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ function BigA1Game:new()
1010
BigA1Game.super:new()
1111
self.big_mode = true
1212
self.half_block_mode = true
13+
self.piece_spawn_offset.x = -1
1314
end
1415

1516
return BigA1Game

tetris/modes/gamemode.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ function GameMode:new(secret_inputs, properties)
7575
self.lock_on_soft_drop = false
7676
self.lock_on_hard_drop = false
7777
self.cleared_block_table = {}
78+
self.piece_spawn_offset = {x = 0, y = 0}
7879
self.last_lcd = 0
7980
self.used_randomizer = nil
8081
self.hold_queue = nil
@@ -687,7 +688,7 @@ function GameMode:initializeNextPiece(
687688
self.drop_locked, self.hard_drop_locked, self.big_mode,
688689
(
689690
self.frames == 0 or (ruleset.are and self:getARE() ~= 0)
690-
) and self.irs or false, self.half_block_mode
691+
) and self.irs or false, self.half_block_mode, self.piece_spawn_offset
691692
)
692693
if config.gamesettings.buffer_lock == 3 then
693694
if self.buffer_hard_drop then

tetris/rulesets/ruleset.lua

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -199,10 +199,10 @@ end
199199
function Ruleset:initializePiece(
200200
inputs, data, grid, gravity, prev_inputs,
201201
move, lock_delay, drop_speed,
202-
drop_locked, hard_drop_locked, big, irs, half_block
202+
drop_locked, hard_drop_locked, big, irs, half_block, offset
203203
)
204204
local spawn_positions
205-
if big and not half_block then
205+
if big then
206206
spawn_positions = self.big_spawn_positions
207207
else
208208
spawn_positions = self.spawn_positions
@@ -233,11 +233,14 @@ function Ruleset:initializePiece(
233233
end
234234

235235
local spawn_y = spawn_positions[data.shape].y - spawn_dy
236-
if big and not half_block then
236+
if big then
237237
spawn_x = spawn_x + math.floor(spawn_positions[data.shape].x * grid.width / 10)
238238
spawn_y = spawn_y + spawn_positions[data.shape].y
239-
elseif big and half_block then
240-
spawn_y = math.ceil(spawn_y / 2) * 2
239+
end
240+
241+
if offset then
242+
spawn_x = spawn_x + offset.x
243+
spawn_y = spawn_y + offset.y
241244
end
242245

243246
local piece = Piece(data.shape, data.orientation - 1, {

0 commit comments

Comments
 (0)