mirror of
https://github.com/flame-engine/flame.git
synced 2025-10-30 00:17:20 +08:00
This upgrades all packages to Flutter 3.0.0 and fixes all analyze issues that came from that.
26 lines
639 B
Dart
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,
|
|
),
|
|
);
|
|
}
|
|
}
|