mirror of
https://github.com/flame-engine/flame.git
synced 2025-11-02 11:43:19 +08:00
Making SpriteComponent and SpriteAnimationComponent follow the same standard for empty constructors (#620)
This commit is contained in:
@ -29,14 +29,15 @@ class MyGame extends BaseGame {
|
||||
spriteSheet.createAnimation(row: 1, stepTime: 0.1, to: 7);
|
||||
final spriteSize = Vector2(80.0, 90.0);
|
||||
|
||||
final vampireComponent =
|
||||
SpriteAnimationComponent(spriteSize, vampireAnimation)
|
||||
..x = 150
|
||||
..y = 100;
|
||||
|
||||
final ghostComponent = SpriteAnimationComponent(spriteSize, ghostAnimation)
|
||||
final vampireComponent = SpriteAnimationComponent.fromSpriteAnimation(
|
||||
spriteSize, vampireAnimation)
|
||||
..x = 150
|
||||
..y = 220;
|
||||
..y = 100;
|
||||
|
||||
final ghostComponent =
|
||||
SpriteAnimationComponent.fromSpriteAnimation(spriteSize, ghostAnimation)
|
||||
..x = 150
|
||||
..y = 220;
|
||||
|
||||
add(vampireComponent);
|
||||
add(ghostComponent);
|
||||
|
||||
Reference in New Issue
Block a user