From 5ab02ec2df3ab1edddf0040efd63c6824ca06225 Mon Sep 17 00:00:00 2001 From: Hadrian Burkhardt Date: Sun, 25 Oct 2026 00:32:28 +0200 Subject: [PATCH] fix(app): publish hud every frame and verify rewarded ads on device --- CHANGELOG.md | 3 +++ app/lib/src/game/iron_arc_game.dart | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 141a76c..59631b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,9 @@ Alle nennenswerten Änderungen an diesem Projekt. Format nach - (sim) `MAX_HP` 100 -> 150 (laengere, taktischere Matches); `SIM_VERSION` 0.2.0 - (app) Version 0.6.0 (6), HP-Balken gegen `kTankMaxHp` +### Fixed +- (app) HUD blieb auf dem Initialwert (100 HP), weil `onLoad` waehrend des ersten Builds publizierte + ### Added - (ads) AdMob App ID im Manifest, `google_mobile_ads`, `AdsService` mit Rewarded/Interstitial und Frequenz-Caps - (ui) Rewarded-Testbutton; Interstitial nach Matchende (ab Match 4, jeder 2.) diff --git a/app/lib/src/game/iron_arc_game.dart b/app/lib/src/game/iron_arc_game.dart index 61789d5..72bb419 100644 --- a/app/lib/src/game/iron_arc_game.dart +++ b/app/lib/src/game/iron_arc_game.dart @@ -113,7 +113,8 @@ class IronArcGame extends FlameGame { @override Future onLoad() async { _match = matchFactory?.call() ?? NativeMatch(seed); - _pushHud(); + // Do not publish here: notifying listeners during the first build is lost. + // The first update() call publishes the loaded state on the next frame. } @override @@ -135,7 +136,6 @@ class IronArcGame extends FlameGame { _accumulator -= step; steps++; } - _pushHud(); } else if (_match.isAiming) { _accumulator = 0; } @@ -155,6 +155,9 @@ class IronArcGame extends FlameGame { } } _wasFlying = flying; + // Publish every frame: the notifier only fires on real changes, and this + // guarantees the first painted frame already shows the loaded match state. + _pushHud(); _updateCamera(dt); }