load texture inside game scene instead inside of inside companion class
This commit is contained in:
parent
e5a196a42b
commit
187e21eed9
5 changed files with 20 additions and 15 deletions
|
@ -71,8 +71,10 @@ export abstract class Character extends Container {
|
|||
this.playAnimation(direction, moving);
|
||||
}
|
||||
|
||||
public addCompanion(name: string): void {
|
||||
this.companion = new Companion(this.scene, this.x, this.y, name);
|
||||
public addCompanion(name: string, texturePromise?: Promise<string>): void {
|
||||
if (typeof texturePromise !== 'undefined') {
|
||||
this.companion = new Companion(this.scene, this.x, this.y, name, texturePromise);
|
||||
}
|
||||
}
|
||||
|
||||
public addTextures(textures: string[], frame?: string | number): void {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue