Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
_move(xy) {
let entity = this._level.getEntity(xy);
if (entity.blocks >= BLOCKS_MOVEMENT) {
log.add("You bump into %a.", entity);
if (entity instanceof cells.Door && !TUTORIAL.door) {
TUTORIAL.door = true;
log.add("To interact with stuff, press both a {#fff}modifier key{} (Ctrl, Alt, Shift or Command) and a {#fff}direction key{} (used for movement).");
}
if (entity instanceof Being && !TUTORIAL.enemy) {
log.add("If you wish to interact with beings (attack them, for example), press both a {#fff}modifier key{} (Ctrl, Alt, Shift or Command) and a {#fff}direction key{} (used for movement).");
TUTORIAL.enemy = true;
}
return;
}
this.moveTo(xy);
this._resolve(); // successful movement
}