PR suggestions

This commit is contained in:
Erick Zanardo
2019-07-02 22:41:36 -03:00
parent cb42631dab
commit 34e7fb314e
4 changed files with 21 additions and 24 deletions

View File

@ -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);