Vector2 for position and size on PositionComponent

This commit is contained in:
Lukas Klingsbo
2020-09-24 23:35:36 +02:00
parent 1625ff568b
commit f97f20ab73
33 changed files with 194 additions and 229 deletions

View File

@@ -22,8 +22,9 @@ class MyGame extends BaseGame {
'chopper.png',
'chopper.json',
);
final animationComponent = SpriteAnimationComponent(200, 200, animation)
..setPosition(size / 2 - Vector2(100, 100));
final spriteSize = Vector2.all(200);
final animationComponent = SpriteAnimationComponent(spriteSize, animation)
..position = size / 2 - Vector2(100, 100);
add(animationComponent);
}