Ensure enemies only lock onto player once they have line of sight
This commit is contained in:
@@ -281,11 +281,13 @@ export class GameScene extends Phaser.Scene {
|
||||
} else if (ev.type === "orb-spawned") {
|
||||
this.dungeonRenderer.spawnOrb(ev.orbId, ev.x, ev.y);
|
||||
} else if (ev.type === "exp-collected" && ev.actorId === this.playerId) {
|
||||
this.dungeonRenderer.collectOrb(ev.actorId, ev.amount, ev.x, ev.y);
|
||||
} else if (ev.type === "leveled-up" && ev.actorId === this.playerId) {
|
||||
this.dungeonRenderer.showLevelUp(ev.x, ev.y);
|
||||
}
|
||||
}
|
||||
this.dungeonRenderer.collectOrb(ev.actorId, ev.amount, ev.x, ev.y);
|
||||
} else if (ev.type === "leveled-up" && ev.actorId === this.playerId) {
|
||||
this.dungeonRenderer.showLevelUp(ev.x, ev.y);
|
||||
} else if (ev.type === "enemy-alerted") {
|
||||
this.dungeonRenderer.showAlert(ev.x, ev.y);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Check if player died
|
||||
|
||||
Reference in New Issue
Block a user