diff --git a/public/css/style.css b/public/css/style.css index 742919b..39aa6ef 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -197,7 +197,6 @@ button:active { display: flex; justify-content: center; align-items: center; - margin-top: 20px; } /* Main player board - centered and large */ diff --git a/server/index.js b/server/index.js index 5a1d89a..7ca8a77 100644 --- a/server/index.js +++ b/server/index.js @@ -396,11 +396,11 @@ function addGarbageToPlayer(player) { garbageRow[Math.floor(Math.random() * BOARD_WIDTH)] = 0; player.board.push(garbageRow); - // Push current piece up by 1 row if it exists + // Push current piece up by 1 row if it exists (y decreases when moving up) if (player.currentPiece) { - player.currentPiece.y++; - // Eliminate if the piece is pushed above the board - if (!isValidPosition(player.currentPiece, player.currentPiece.x, player.currentPiece.y, player.board)) { + player.currentPiece.y--; + // Eliminate if the piece is pushed above the board or collides + if (player.currentPiece.y < 0 || !isValidPosition(player.currentPiece, player.currentPiece.x, player.currentPiece.y, player.board)) { player.eliminated = true; } }