Formatting

This commit is contained in:
Lukas Klingsbo
2020-09-24 23:47:47 +02:00
parent 1f4db84c0d
commit 436e5ecc8a
3 changed files with 9 additions and 10 deletions

View File

@ -50,10 +50,8 @@ class MyGame extends BaseGame {
Flame.audio.load('boin.mp3'); Flame.audio.load('boin.mp3');
Flame.audio.loop('music.mp3', volume: 0.4); Flame.audio.loop('music.mp3', volume: 0.4);
add( add(Ball(size)
Ball(size) ..y = (size.y / 2) - 50
..y = (size.y / 2) - 50 ..size = Vector2(100, 100));
..size = Vector2(100, 100)
);
} }
} }

View File

@ -58,9 +58,10 @@ class MyGame extends BaseGame {
final ghostAnimation = spriteSheet.createAnimation(1, stepTime: 0.1, to: 7); final ghostAnimation = spriteSheet.createAnimation(1, stepTime: 0.1, to: 7);
final spriteSize = Vector2(80, 90); final spriteSize = Vector2(80, 90);
final vampireComponent = SpriteAnimationComponent(spriteSize, vampireAnimation) final vampireComponent =
..x = 150 SpriteAnimationComponent(spriteSize, vampireAnimation)
..y = 100; ..x = 150
..y = 100;
final ghostComponent = SpriteAnimationComponent(spriteSize, ghostAnimation) final ghostComponent = SpriteAnimationComponent(spriteSize, ghostAnimation)
..x = 150 ..x = 150

View File

@ -36,12 +36,12 @@ class FlareAnimation {
double get width => size.x; double get width => size.x;
double get height => size.y; double get height => size.y;
set size(Vector2 newSize) { set size(Vector2 newSize) {
_size.setFrom(newSize); _size.setFrom(newSize);
_scale.setValues(_size.x / _artboard.width, _size.y / _artboard.height); _scale.setValues(_size.x / _artboard.width, _size.y / _artboard.height);
} }
Vector2 get size => _size; Vector2 get size => _size;
void updateAnimation(String animation) { void updateAnimation(String animation) {