Added entity interaction for non-zone entities

This commit is contained in:
Collin Smith 2019-03-11 02:07:18 -07:00
parent 9d2b5e1494
commit ad931e0e8e

View File

@ -59,6 +59,18 @@ public class MapListener {
}
}
}
for (Entity entity : gameScreen.entities.values()) {
if (entity.isOver()) {
if (entity.position().dst(gameScreen.player.position()) <= entity.getInteractRange()) {
setTarget(null);
entity.interact(gameScreen);
} else {
setTarget(entity);
}
return true;
}
}
return false;
}