diff --git a/front/src/Phaser/Game/PlayerMovement.ts b/front/src/Phaser/Game/PlayerMovement.ts index 7758f010..274cbee1 100644 --- a/front/src/Phaser/Game/PlayerMovement.ts +++ b/front/src/Phaser/Game/PlayerMovement.ts @@ -41,7 +41,7 @@ export class PlayerMovement { oldX: this.startPosition.x, oldY: this.startPosition.y, direction: this.endPosition.direction, - moving: true, + moving: this.endPosition.moving, }; } } diff --git a/front/src/Phaser/Player/Player.ts b/front/src/Phaser/Player/Player.ts index 17ad1cc1..adf7a302 100644 --- a/front/src/Phaser/Player/Player.ts +++ b/front/src/Phaser/Player/Player.ts @@ -117,7 +117,7 @@ export class Player extends Character { const distance = Math.pow(xDist, 2) + Math.pow(yDist, 2); - if (distance < 650) { + if (distance < 2000) { this.stop(); } else { const moveAmount = 9 * 20; diff --git a/front/tests/Phaser/Game/PlayerMovementTest.ts b/front/tests/Phaser/Game/PlayerMovementTest.ts index 70f7b95d..bd5f40b4 100644 --- a/front/tests/Phaser/Game/PlayerMovementTest.ts +++ b/front/tests/Phaser/Game/PlayerMovementTest.ts @@ -74,7 +74,7 @@ describe("Interpolation / Extrapolation", () => { }); }); - it("should should keep moving until it stops", () => { + it("should keep moving until it stops", () => { const playerMovement = new PlayerMovement({ x: 100, y: 200 }, 42000, @@ -95,7 +95,7 @@ describe("Interpolation / Extrapolation", () => { oldX: 100, oldY: 200, direction: 'up', - moving: true + moving: false }); }); })