mirror of
https://github.com/flame-engine/flame.git
synced 2025-11-01 10:38:17 +08:00
feat!: Add CameraComponent to FlameGame (#2740)
This PR adds the `CameraComponent` and a `World` by default to the FlameGame.
This commit is contained in:
@ -17,8 +17,7 @@ class LookAtSmoothExample extends FlameGame {
|
||||
'oriented in the desired direction if the image is not facing the '
|
||||
'correct direction.';
|
||||
|
||||
final world = _TapWorld();
|
||||
late final CameraComponent cameraComponent;
|
||||
LookAtSmoothExample() : super(world: _TapWorld());
|
||||
|
||||
late SpriteAnimationComponent _chopper1;
|
||||
late SpriteAnimationComponent _chopper2;
|
||||
@ -28,9 +27,6 @@ class LookAtSmoothExample extends FlameGame {
|
||||
|
||||
@override
|
||||
Future<void> onLoad() async {
|
||||
cameraComponent = CameraComponent(world: world);
|
||||
addAll([cameraComponent, world]);
|
||||
|
||||
final spriteSheet = SpriteSheet(
|
||||
image: await images.load('animations/chopper.png'),
|
||||
srcSize: Vector2.all(48),
|
||||
|
||||
Reference in New Issue
Block a user