Closed Stef-GMS closed 1 year ago
class Unicorn extends PositionedEntity with HasGameRef {
Unicorn({
required super.position,
}) : super(
anchor: Anchor.center,
size: Vector2.all(32),
behaviors: [
TappingBehavior(),
],
);
late SpriteAnimationComponent? _animation;
@visibleForTesting
Unicorn.test({
required super.position,
super.behaviors,
}) : super(size: Vector2.all(32));
@visibleForTesting
SpriteAnimationComponent get animation => _animation!;
@override
Future<void> onLoad() async {
_animation = SpriteAnimationComponent(
animation: await gameRef.loadSpriteAnimation(
Assets.images.unicornAnimation.path,
SpriteAnimationData.sequenced(
amount: 16,
stepTime: 0.1,
textureSize: Vector2.all(32),
loop: false,
),
),
size: size,
);
await add(animation);
}
/// Plays the animation.
void playAnimation() => animation.animationTicker!.reset();
/// Returns whether the animation is playing or not.
bool isAnimationPlaying() => !animation.animationTicker!.isLastFrame;
}
Description When using the VGV CLI to create a Flame game there are 13 errors listed in Dart Analysis and the template app won't run.
Steps To Reproduce
very_good create flutter_app very_good_flutter_app --desc "A Flutter app built using Very Good Ventures Very Good CLI"
Sprite Animation
.HasTappables
andCamera
have been deprecated (I knowCamera
deprecation is in the last week).Expected Behavior No Dart Analysis errors to be listed.
Screenshots
Additional Context Macbook Pro M1 macOS 13.3.1 IntelliJ IDEA 2022.3.3 (Community Edition) Flutter 3.10.0 (tried rolling back. Still gave errors) Dart Dart 3.0.2 (tried rolling back. Still gave errors) pubspec.yaml was not updated so entries remained as shown below. Even updating them didn't solve issue. I also tried rolling back. Still gave errors)