mirror of
https://github.com/flame-engine/flame.git
synced 2025-11-02 03:15:43 +08:00
PR suggestions
This commit is contained in:
@ -20,8 +20,6 @@ class MyGame extends BaseGame {
|
||||
final animation = flame_animation.Animation.sequenced('chopper.png', 4,
|
||||
textureWidth: 48, textureHeight: 48, stepTime: 0.15);
|
||||
|
||||
Size screenSize;
|
||||
|
||||
void addAnimation() {
|
||||
final animationComponent = AnimationComponent(100, 100, animation, destroyOnFinish: true);
|
||||
animationComponent.x = size.width / 2 - 50;
|
||||
@ -30,14 +28,16 @@ class MyGame extends BaseGame {
|
||||
add(animationComponent);
|
||||
}
|
||||
|
||||
MyGame(this.screenSize) {
|
||||
MyGame(Size screenSize) {
|
||||
size = screenSize;
|
||||
|
||||
final animationComponent = AnimationComponent(100, 100, animation);
|
||||
animationComponent.x = screenSize.width / 2 - 100;
|
||||
animationComponent.x = size.width / 2 - 100;
|
||||
animationComponent.y = 100;
|
||||
|
||||
final reversedAnimationComponent =
|
||||
AnimationComponent(100, 100, animation.reversed());
|
||||
reversedAnimationComponent.x = screenSize.width / 2;
|
||||
reversedAnimationComponent.x = size.width / 2;
|
||||
reversedAnimationComponent.y = 100;
|
||||
|
||||
add(animationComponent);
|
||||
|
||||
Reference in New Issue
Block a user