Finalizing strict mode fixes
This commit is contained in:
parent
6f69a62d4d
commit
b82b13e351
9 changed files with 139 additions and 110 deletions
38
front/src/Phaser/Entity/RemotePlayer.ts
Normal file
38
front/src/Phaser/Entity/RemotePlayer.ts
Normal file
|
@ -0,0 +1,38 @@
|
|||
import {GameScene} from "../Game/GameScene";
|
||||
import {PointInterface} from "../../Connection";
|
||||
import {Character} from "../Entity/Character";
|
||||
|
||||
/**
|
||||
* Class representing the sprite of a remote player (a player that plays on another computer)
|
||||
*/
|
||||
export class RemotePlayer extends Character {
|
||||
userId: string;
|
||||
previousDirection: string;
|
||||
wasMoving: boolean;
|
||||
|
||||
constructor(
|
||||
userId: string,
|
||||
Scene: GameScene,
|
||||
x: number,
|
||||
y: number,
|
||||
name: string,
|
||||
PlayerTexture: string,
|
||||
direction: string,
|
||||
moving: boolean
|
||||
) {
|
||||
super(Scene, x, y, PlayerTexture, name, direction, moving, 1);
|
||||
|
||||
//set data
|
||||
this.userId = userId;
|
||||
|
||||
//the current player model should be push away by other players to prevent conflict
|
||||
//this.setImmovable(false);
|
||||
}
|
||||
|
||||
updatePosition(position: PointInterface): void {
|
||||
this.playAnimation(position.direction, position.moving);
|
||||
this.setX(position.x);
|
||||
this.setY(position.y);
|
||||
this.setDepth(position.y);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue