Implement shared 7-bag piece sequence

- Add generatePieceBag() and createPieceQueue() for 7-bag system
- Add pieceQueue and playerSequenceIndex to lobby state
- Modify spawnPiece() to consume from shared queue per player
- Update player-hold handler to manage sequence index on hold
- Add sequenceIndex to state updates for tracking
- Update client loadState() to receive sequenceIndex

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-21 01:37:55 +00:00
parent bdeb6c8849
commit 634c6e8eab
2 changed files with 87 additions and 6 deletions
+1
View File
@@ -366,6 +366,7 @@ class TetrisGame {
this.level = state.level;
this.gameOver = state.gameOver;
this.eliminated = state.eliminated;
this.sequenceIndex = state.sequenceIndex || 0;
this.dropInterval = Math.max(100, 1000 - (this.level - 1) * 100);
}
}