don't fail if companion texture is not found

This commit is contained in:
Johannes Berthel 2021-04-02 21:26:24 +02:00
parent c07079051a
commit fc3a503bcf
2 changed files with 16 additions and 14 deletions

View file

@ -36,10 +36,12 @@ export class Companion extends Container {
this.companionName = name;
lazyLoadResource(this.scene.load, this.companionName).then(resource => {
this.addResource(resource);
this.invisible = false;
})
lazyLoadResource(this.scene.load, this.companionName)
.then(resource => {
this.addResource(resource);
this.invisible = false;
})
.catch(error => console.error(error));
this.scene.physics.world.enableBody(this);