Adding event support to items

This commit is contained in:
David Négrier 2020-07-27 22:36:07 +02:00
parent 513244ae1f
commit ee612f6585
11 changed files with 253 additions and 36 deletions

View file

@ -13,9 +13,8 @@ export interface CurrentGamerInterface extends Character{
}
export class Player extends Character implements CurrentGamerInterface {
userInputManager: UserInputManager;
previousDirection: string;
wasMoving: boolean;
private previousDirection: string;
private wasMoving: boolean;
constructor(
Scene: GameScene,
@ -24,13 +23,11 @@ export class Player extends Character implements CurrentGamerInterface {
name: string,
PlayerTexture: string,
direction: string,
moving: boolean
moving: boolean,
private userInputManager: UserInputManager
) {
super(Scene, x, y, PlayerTexture, name, direction, moving, 1);
//create input to move
this.userInputManager = new UserInputManager(Scene);
//the current player model should be push away by other players to prevent conflict
this.setImmovable(false);
}