chore: Remove 1.8.0 deprecations (#2538)

Removes all the deprecated methods before 1.8.0 release.
This commit is contained in:
Lukas Klingsbo
2023-05-22 19:01:55 +02:00
committed by GitHub
parent 6e1d5466aa
commit 2d45d2be39
139 changed files with 1224 additions and 1084 deletions

View File

@ -17,9 +17,14 @@ starts to drop in FPS, this is without any sprite batching and such.
final counterPrefix = 'Animations: ';
final Random random = Random();
final world = World();
late final CameraComponent cameraComponent;
@override
Future<void> onLoad() async {
await addAll([
cameraComponent = CameraComponent(world: world);
addAll([cameraComponent, world]);
await cameraComponent.viewport.addAll([
FpsTextComponent(
position: size - Vector2(0, 50),
anchor: Anchor.bottomRight,
@ -29,29 +34,28 @@ starts to drop in FPS, this is without any sprite batching and such.
anchor: Anchor.bottomRight,
priority: 1,
),
Ember(size: emberSize, position: size / 2),
]);
world.add(Ember(size: emberSize, position: size / 2));
children.register<Ember>();
}
@override
void update(double dt) {
super.update(dt);
emberCounter.text = '$counterPrefix ${children.query<Ember>().length}';
emberCounter.text =
'$counterPrefix ${world.children.query<Ember>().length}';
}
@override
void onTapDown(TapDownInfo info) {
final halfWidth = emberSize.x / 2;
final halfHeight = emberSize.y / 2;
addAll(
world.addAll(
List.generate(
100,
(_) => Ember(
size: emberSize,
position: Vector2(
halfWidth + (size.x - halfWidth) * random.nextDouble(),
halfHeight + (size.y - halfHeight) * random.nextDouble(),
(size.x / 2) * random.nextDouble() * (random.nextBool() ? 1 : -1),
(size.y / 2) * random.nextDouble() * (random.nextBool() ? 1 : -1),
),
),
),