This commit is contained in:
Piotr 'pwh' Hanusiak
2022-03-22 16:53:23 +01:00
parent f446918e42
commit fcf8659829
3 changed files with 0 additions and 30 deletions
@@ -1,27 +0,0 @@
import Container = Phaser.GameObjects.Container;
import type { Scene } from "phaser";
import Sprite = Phaser.GameObjects.Sprite;
import { getPlayerAnimations, PlayerAnimationDirections, PlayerAnimationTypes } from "../Player/Animation";
/**
* A sprite of a customized character (used in the Customize Scene only)
*/
export class CustomizedCharacter extends Container {
private sprites: Phaser.GameObjects.Sprite[];
public constructor(scene: Scene, x: number, y: number, layers: string[]) {
super(scene, x, y);
this.sprites = [];
this.updateSprites(layers);
}
public updateSprites(layers: string[]): void {
this.sprites = [];
this.removeAll(true);
for (const texture of layers) {
const newSprite = new Sprite(this.scene, 0, 0, texture);
this.sprites.push(newSprite);
}
this.add(this.sprites);
}
}