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
|
@ -22,7 +22,8 @@ export class Player extends Character implements CurrentGamerInterface {
|
|||
direction: PlayerAnimationDirections,
|
||||
moving: boolean,
|
||||
private userInputManager: UserInputManager,
|
||||
companion: string|null
|
||||
companion: string|null,
|
||||
companionTexturePromise?: Promise<string>
|
||||
) {
|
||||
super(Scene, x, y, texturesPromise, name, direction, moving, 1);
|
||||
|
||||
|
@ -30,7 +31,7 @@ export class Player extends Character implements CurrentGamerInterface {
|
|||
this.getBody().setImmovable(false);
|
||||
|
||||
if (typeof companion === 'string') {
|
||||
this.addCompanion(companion);
|
||||
this.addCompanion(companion, companionTexturePromise);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue