Adjusted spawn x positions

This commit is contained in:
Ishaan Bhardwaj 2021-01-11 14:48:03 -05:00
parent 6fb19220b7
commit 512c2149f0

View File

@ -222,8 +222,17 @@ function Ruleset:initializePiece(
end end
local colours = ({self.colourscheme, ColourSchemes.Arika, ColourSchemes.TTC})[config.gamesettings.piece_colour] local colours = ({self.colourscheme, ColourSchemes.Arika, ColourSchemes.TTC})[config.gamesettings.piece_colour]
local percent = spawn_positions[data.shape].x / 10
local spawn_x
for i = 0, grid.width - 1 do
if i / grid.width >= percent then
spawn_x = i
break
end
end
local piece = Piece(data.shape, data.orientation - 1, { local piece = Piece(data.shape, data.orientation - 1, {
x = spawn_positions[data.shape].x, x = spawn_x,
y = spawn_positions[data.shape].y y = spawn_positions[data.shape].y
}, self.block_offsets, 0, 0, data.skin, colours[data.shape], big) }, self.block_offsets, 0, 0, data.skin, colours[data.shape], big)