feat(engine): hammer booster removes one cell, no scoring
This commit is contained in:
@@ -216,4 +216,15 @@ class GameEngine {
|
||||
}
|
||||
_phase = GamePhase.lost;
|
||||
}
|
||||
|
||||
/// Booster: empties one filled cell. No move/score/combo/objective effect.
|
||||
/// Allowed only mid-attempt (playing or stuck). Returns false on an empty
|
||||
/// cell or finished attempt so the caller keeps the booster.
|
||||
bool useHammer(int x, int y) {
|
||||
if (_phase == GamePhase.won || _phase == GamePhase.lost) return false;
|
||||
if (!_grid.isOccupied(x, y)) return false;
|
||||
_grid = _grid.withCell(x, y, const Cell(CellType.empty));
|
||||
_checkStuck();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user