fix: hide spent rescue to prevent StateError crash; log per-attempt starts
Expose engine.rescueUsed getter and surface it through GameViewState so the result overlay can omit the watch-ad FilledButton after a rescue has been consumed, preventing a second tap from calling useContinue / addExtraMoves and hitting their StateError guard. Give-up is promoted to FilledButton when rescue is unavailable for clear affordance. Also emit stageStart / endlessStart analytics in restart() so every attempt (not just the first) is bracketed by a matching start event. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -82,6 +82,7 @@ class GameEngine {
|
||||
List<Objective> get objectives => List.unmodifiable(_objectives);
|
||||
GamePhase get phase => _phase;
|
||||
StuckReason? get stuckReason => _stuckReason;
|
||||
bool get rescueUsed => _rescueUsed;
|
||||
|
||||
int get starsEarned => _phase == GamePhase.won
|
||||
? _stage.stars.starsFor(movesLeft: movesLeft)
|
||||
|
||||
Reference in New Issue
Block a user