mirror of
https://github.com/flame-engine/flame.git
synced 2025-11-02 20:13:50 +08:00
Formatting
This commit is contained in:
@ -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)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user