Cancel targetting if player moves

This commit is contained in:
Peter Stockings
2026-01-06 22:39:02 +11:00
parent 505f62ac97
commit f9b1abee6e

View File

@@ -410,6 +410,9 @@ export class GameScene extends Phaser.Scene {
if (this.cursors.down!.isDown) dy += 1;
if (dx !== 0 || dy !== 0) {
if (this.isTargeting) {
this.cancelTargeting();
}
const player = this.world.actors.get(this.playerId) as CombatantActor;
const targetX = player.pos.x + dx;
const targetY = player.pos.y + dy;