mirror of
https://github.com/LDDestroier/CC/
synced 2025-01-07 07:50:26 +00:00
Update ldris.lua
This commit is contained in:
parent
66c6f32ecd
commit
4674858294
38
ldris.lua
38
ldris.lua
@ -48,7 +48,8 @@ local game = {
|
|||||||
rotateRight = keys.x, -- rotate clockwise
|
rotateRight = keys.x, -- rotate clockwise
|
||||||
fastDrop = keys.up, -- instantly drop and place piece
|
fastDrop = keys.up, -- instantly drop and place piece
|
||||||
hold = keys.leftShift, -- slot piece into hold buffer
|
hold = keys.leftShift, -- slot piece into hold buffer
|
||||||
quit = keys.q -- fuck off
|
quit = keys.q, -- fuck off
|
||||||
|
pause = keys.p
|
||||||
},
|
},
|
||||||
revControl = {}, -- a mirror of "control", but with the keys and values inverted
|
revControl = {}, -- a mirror of "control", but with the keys and values inverted
|
||||||
net = { -- all network-related values
|
net = { -- all network-related values
|
||||||
@ -446,12 +447,33 @@ local makeNewMino = function(minoType, board, x, y, replaceColor)
|
|||||||
checkTspin(mino)
|
checkTspin(mino)
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
-- kick off ceiling
|
||||||
|
for y = 1, #mino.shape do
|
||||||
|
for x = -1, 1 do
|
||||||
|
if not mino.checkCollision(x, y) then
|
||||||
|
mino.x = mino.x + x
|
||||||
|
mino.y = mino.y + y
|
||||||
|
--checkTspin(mino)
|
||||||
|
--return true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
-- kick off floor
|
-- kick off floor
|
||||||
for y = 1, math.floor(#mino.shape / 2) do
|
for y = 1, math.floor(#mino.shape / 2) do
|
||||||
if not mino.checkCollision(0, -y) then
|
if not mino.checkCollision(0, -y) then
|
||||||
mino.y = mino.y - y
|
mino.y = mino.y - y
|
||||||
checkTspin(mino)
|
checkTspin(mino)
|
||||||
return true
|
return true
|
||||||
|
elseif not mino.checkCollision(-1, -y) then
|
||||||
|
mino.y = mino.y - y
|
||||||
|
mino.x = mino.x - 1
|
||||||
|
checkTspin(mino)
|
||||||
|
return true
|
||||||
|
elseif not mino.checkCollision(1, -y) then
|
||||||
|
mino.y = mino.y - y
|
||||||
|
mino.x = mino.x + 1
|
||||||
|
checkTspin(mino)
|
||||||
|
return true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- kick off right wall
|
-- kick off right wall
|
||||||
@ -865,10 +887,24 @@ local startGame = function(playerNumber)
|
|||||||
|
|
||||||
if game.paused then
|
if game.paused then
|
||||||
if control.pause == 1 then
|
if control.pause == 1 then
|
||||||
|
for k,v in pairs(normalPalettes) do
|
||||||
|
if k == "c" then
|
||||||
|
term.setPaletteColor(to_colors[k], 0x0f0f0f)
|
||||||
|
else
|
||||||
|
term.setPaletteColor(to_colors[k], table.unpack(v))
|
||||||
|
end
|
||||||
|
end
|
||||||
game.paused = false
|
game.paused = false
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if control.pause == 1 then
|
if control.pause == 1 then
|
||||||
|
for k,v in pairs(darkerPalettes) do
|
||||||
|
if k == "c" then
|
||||||
|
term.setPaletteColor(to_colors[k], 0.1, 0.1, 0.1)
|
||||||
|
else
|
||||||
|
term.setPaletteColor(to_colors[k], table.unpack(v))
|
||||||
|
end
|
||||||
|
end
|
||||||
game.paused = true
|
game.paused = true
|
||||||
end
|
end
|
||||||
if not cPlayer.frozen then
|
if not cPlayer.frozen then
|
||||||
|
Loading…
Reference in New Issue
Block a user