staging #20

Merged
marco merged 52 commits from staging into master 2021-10-09 18:48:59 +00:00
4 changed files with 6 additions and 2 deletions
Showing only changes of commit eb7491a852 - Show all commits

Binary file not shown.

After

Width:  |  Height:  |  Size: 472 KiB

View File

@ -19,7 +19,7 @@ class Firework extends Component {
SpriteAnimation normal = SpriteAnimation.fromFrameData(
firework,
SpriteAnimationData.sequenced(
amount: 9,
amount: 10,
stepTime: 0.25,
textureSize: Vector2(512, 512),
loop: false,

View File

@ -170,7 +170,8 @@ class MyGame extends BaseGame with PanDetector, TapDetector, KeyboardEvents {
bool shouldReset = false;
void reset() {
if (!(runner.sprite.animation?.done() ?? false)) {
if (!(runner.sprite.animation?.done() ?? false) &&
runner.sprite.animation!.loop == false) {
return;
}
runner.sprite.animation!.reset();

View File

@ -218,6 +218,9 @@ class Runner extends Component with HasGameRef<MyGame> {
@override
void update(double dt) {
super.update(dt);
if (sprite.position.y + sprite.size.y >= gameRef.size.y) {
event("die");
}
// If the animation is finished
if (sprite.animation?.done() ?? false) {
sprite.animation!.reset();