feat: Add bonus flash effect for player pickups and update rendering logic

Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
This commit is contained in:
2026-03-23 12:11:19 +01:00
parent 604923618a
commit 8ed460b03e
7 changed files with 165 additions and 37 deletions
@@ -102,5 +102,18 @@ void main() {
}
expect(player.lives, 9);
});
test('successful pickups trigger bonus flash and it fades over time', () {
final player = Player(x: 1.5, y: 1.5, angle: 0)..health = 50;
final food = HealthCollectible(x: 1, y: 1, mapId: MapObject.food);
expect(player.bonusFlash, 0.0);
player.tryPickup(food);
expect(player.bonusFlash, 1.0);
player.tick(const Duration(milliseconds: 16));
expect(player.bonusFlash, lessThan(1.0));
expect(player.bonusFlash, greaterThan(0.0));
});
});
}