made the player pushable by other models
This commit is contained in:
parent
2b2b615e7b
commit
d1106d757d
@ -103,6 +103,10 @@ export class GameScene extends Phaser.Scene implements GameSceneInterface{
|
|||||||
let eventList = this.userInputManager.getEventListForGameTick();
|
let eventList = this.userInputManager.getEventListForGameTick();
|
||||||
|
|
||||||
this.player.move(eventList);
|
this.player.move(eventList);
|
||||||
|
|
||||||
|
this.otherPlayers.getChildren().forEach((otherPlayer: NonPlayer) => {
|
||||||
|
otherPlayer.setVelocity(20, 5);
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
sharedUserPosition(data: []): void {
|
sharedUserPosition(data: []): void {
|
||||||
|
@ -8,7 +8,7 @@ export class Player extends PlayableCaracter{
|
|||||||
|
|
||||||
constructor(scene: Phaser.Scene, x: number, y: number) {
|
constructor(scene: Phaser.Scene, x: number, y: number) {
|
||||||
super(scene, x, y, Textures.Player, 26);
|
super(scene, x, y, Textures.Player, 26);
|
||||||
this.setImmovable(false);
|
this.setImmovable(false); //the current player model should be push away by other players to prevent conflict
|
||||||
this.setSize(32, 32); //edit the hitbox to better match the caracter model
|
this.setSize(32, 32); //edit the hitbox to better match the caracter model
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user