For Oshisaure :)

This commit is contained in:
Ishaan Bhardwaj 2020-10-07 13:24:28 -04:00
parent 3cc918841f
commit bdad32ac79

View File

@ -58,7 +58,8 @@ function Grid:canPlaceBigPiece(piece)
for index, offset in pairs(offsets) do for index, offset in pairs(offsets) do
local x = piece.position.x + offset.x local x = piece.position.x + offset.x
local y = piece.position.y + offset.y local y = piece.position.y + offset.y
if x >= 5 or x < 0 or y >= 12 or y < 0 or if y < 0 then return true
elseif x >= 5 or x < 0 or y >= 12 or
self.grid[y * 2 + 1][x * 2 + 1] ~= empty or self.grid[y * 2 + 1][x * 2 + 1] ~= empty or
self.grid[y * 2 + 1][x * 2 + 2] ~= empty or self.grid[y * 2 + 1][x * 2 + 2] ~= empty or
self.grid[y * 2 + 2][x * 2 + 1] ~= empty or self.grid[y * 2 + 2][x * 2 + 1] ~= empty or
@ -150,12 +151,14 @@ function Grid:applyPiece(piece)
for index, offset in pairs(offsets) do for index, offset in pairs(offsets) do
x = piece.position.x + offset.x x = piece.position.x + offset.x
y = piece.position.y + offset.y y = piece.position.y + offset.y
if y + 1 > 0 then
self.grid[y+1][x+1] = { self.grid[y+1][x+1] = {
skin = piece.skin, skin = piece.skin,
colour = piece.shape colour = piece.shape
} }
end end
end end
end
function Grid:applyBigPiece(piece) function Grid:applyBigPiece(piece)
offsets = piece:getBlockOffsets() offsets = piece:getBlockOffsets()