added win screen and level system

Signed-off-by: Pascal Syma <pascal@syma.dev>
This commit is contained in:
2020-07-17 03:20:59 +02:00
parent cea1740792
commit 13e7c24b65
16 changed files with 404 additions and 87 deletions
+1 -12
View File
@@ -33,21 +33,10 @@ export default class Entity extends Phaser.GameObjects.Sprite {
if (shouldDie) {
this.body.velocity.x = 0;
this.setData('active', false);
this.die();
} else {
setTimeout(() => this.hitCooldown = false, 1000);
}
if (this.hitAnimation !== null) {
// TODO: bug, not working, no clue why not
this.anims.stop();
this.play(this.hitAnimation)
.once('animationcomplete', () => {
if (shouldDie) this.die()
});
} else {
if (shouldDie)
this.die();
}
}
die() {