Cancel targetting if player moves
This commit is contained in:
@@ -410,6 +410,9 @@ export class GameScene extends Phaser.Scene {
|
|||||||
if (this.cursors.down!.isDown) dy += 1;
|
if (this.cursors.down!.isDown) dy += 1;
|
||||||
|
|
||||||
if (dx !== 0 || dy !== 0) {
|
if (dx !== 0 || dy !== 0) {
|
||||||
|
if (this.isTargeting) {
|
||||||
|
this.cancelTargeting();
|
||||||
|
}
|
||||||
const player = this.world.actors.get(this.playerId) as CombatantActor;
|
const player = this.world.actors.get(this.playerId) as CombatantActor;
|
||||||
const targetX = player.pos.x + dx;
|
const targetX = player.pos.x + dx;
|
||||||
const targetY = player.pos.y + dy;
|
const targetY = player.pos.y + dy;
|
||||||
|
|||||||
Reference in New Issue
Block a user