Refactor sizing hitbox charactere

This commit is contained in:
gparant 2020-04-13 16:53:19 +02:00
parent 2ce6ed2d48
commit ba3f0e07f8
2 changed files with 2 additions and 3 deletions

View File

@ -14,7 +14,8 @@ export class PlayableCaracter extends Phaser.Physics.Arcade.Sprite {
this.scene.physics.world.enableBody(this); this.scene.physics.world.enableBody(this);
this.setImmovable(true); this.setImmovable(true);
this.setCollideWorldBounds(true); this.setCollideWorldBounds(true);
this.setSize(32, 32); //edit the hitbox to better match the caracter model this.setSize(16, 16); //edit the hitbox to better match the caracter model
this.setOffset(8, 16);
} }
move(x: number, y: number){ move(x: number, y: number){

View File

@ -50,8 +50,6 @@ export class Player extends PlayableCaracter implements CurrentGamerInterface, G
//the current player model should be push away by other players to prevent conflict //the current player model should be push away by other players to prevent conflict
this.setImmovable(false); this.setImmovable(false);
//edit the hitbox to better match the caracter model
this.setSize(32, 32);
} }
initAnimation(): void { initAnimation(): void {