feat: Implement game restart, battlefield styling with art crops and tapped stacks, and initial draw fixes.
Some checks failed
Build and Deploy / build (push) Failing after 1m10s
Some checks failed
Build and Deploy / build (push) Failing after 1m10s
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
---
|
||||
title: Fix Restart Game Action
|
||||
status: Completed
|
||||
---
|
||||
|
||||
## Objectives
|
||||
- Fix the "Restart Game" button not actually resetting the game state fully (players were left with empty hands).
|
||||
|
||||
## Diagnosis
|
||||
- The `restartGame` method in `GameManager` correctly reset the global state (turn, phase, step) and moved cards back to the library.
|
||||
- However, it **failed to trigger the initial card draw** (Mulligan phase start).
|
||||
- This happened because `RulesEngine.startGame()` (which handles the initial draw loop) was never called after the reset.
|
||||
|
||||
## Fix Implemented
|
||||
- Updated `GameManager.ts` to instantiate a new `RulesEngine` and call `.startGame()` at the end of `restartGame`.
|
||||
- This ensures that after resetting variables, the engine immediately shuffles libraries and deals 7 cards to each player, effectively restarting the match.
|
||||
|
||||
## Verification
|
||||
- Clicking "Restart Game" now properly resets life totals, clears the board, and deals a fresh opening hand to all players.
|
||||
Reference in New Issue
Block a user