mirror of
https://github.com/cmclark00/mintris.git
synced 2025-05-18 02:35:21 +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 (holdPiece == null) {
|
||||||
// If no piece is held, hold current piece and spawn new one
|
// If no piece is held, hold current piece and spawn new one
|
||||||
holdPiece = current
|
holdPiece = current
|
||||||
|
currentPiece = nextPiece
|
||||||
spawnNextPiece()
|
spawnNextPiece()
|
||||||
spawnPiece()
|
// Reset position of new piece
|
||||||
|
currentPiece?.apply {
|
||||||
|
x = (width - getWidth()) / 2
|
||||||
|
y = 0
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// Swap current piece with held piece
|
// Swap current piece with held piece
|
||||||
currentPiece = holdPiece
|
currentPiece = holdPiece
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue