Files
flame/examples/lib/commons/ember.dart
Lukas Klingsbo 2a41d0d683 feat: Move to Flutter 3.0.0 and Dart 2.17.0 (#1713)
This upgrades all packages to Flutter 3.0.0 and fixes all analyze issues that came from that.
2022-06-08 06:04:40 +00:00

26 lines
639 B
Dart

import 'package:flame/components.dart';
import 'package:flame/game.dart';
import 'package:meta/meta.dart';
class Ember<T extends FlameGame> extends SpriteAnimationComponent
with HasGameRef<T> {
Ember({super.position, Vector2? size, super.priority})
: super(
size: size ?? Vector2.all(50),
anchor: Anchor.center,
);
@mustCallSuper
@override
Future<void> onLoad() async {
animation = await gameRef.loadSpriteAnimation(
'animations/ember.png',
SpriteAnimationData.sequenced(
amount: 3,
textureSize: Vector2.all(16),
stepTime: 0.15,
),
);
}
}