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
+23
View File
@@ -45,6 +45,29 @@ export default class TextElement {
scene.scene.start('GUI', {key: 'MainMenu'});
break;
case "main_tutorial":
this.endMyself();
if (this.scene.textures.exists('char'))
this.scene.textures.removeKey('char');
this.scene.textures.addSpriteSheet('char', this.scene.textures.get('charA').getSourceImage(), {
frameWidth: 79,
frameHeight: 63,
margin: 1,
spacing: 2
});
this.scene.anims.remove('idle');
this.scene.anims.create({
key: 'idle',
frames: this.scene.anims.generateFrameNumbers('char', {start: 126, end: 131}),
frameRate: 10,
repeat: -1
});
scene.scene.start('Game', {level: 'tutorial'});
break;
}
});
}