mirror of
https://github.com/cmclark00/mintris.git
synced 2025-05-18 00:15:20 +01:00
fix: hold piece now correctly uses next piece preview on first hold
This commit is contained in:
parent
03ff049bef
commit
ce19427cca
1 changed files with 6 additions and 1 deletions
|
@ -97,8 +97,13 @@ class GameBoard(
|
|||
if (holdPiece == null) {
|
||||
// If no piece is held, hold current piece and spawn new one
|
||||
holdPiece = current
|
||||
currentPiece = nextPiece
|
||||
spawnNextPiece()
|
||||
spawnPiece()
|
||||
// Reset position of new piece
|
||||
currentPiece?.apply {
|
||||
x = (width - getWidth()) / 2
|
||||
y = 0
|
||||
}
|
||||
} else {
|
||||
// Swap current piece with held piece
|
||||
currentPiece = holdPiece
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue