move to the nearest tile if possible

This commit is contained in:
Hanusiak Piotr 2022-01-18 12:33:46 +01:00
parent 67cd0dfb29
commit 1c4e803dd7
3 changed files with 77 additions and 4 deletions

View file

@ -31,7 +31,7 @@ export class GameSceneUserInputHandler implements UserInputHandlerInterface {
.getTileIndexAt(this.gameScene.CurrentPlayer.x, this.gameScene.CurrentPlayer.y);
this.gameScene
.getPathfindingManager()
.findPath(startTile, index)
.findPath(startTile, index, true)
.then((path) => {
const tileDimensions = this.gameScene.getGameMap().getTileDimensions();
const pixelPath = path.map((step) => {