1
0
mirror of https://github.com/ynerant/Level-Editor.git synced 2025-01-08 07:32:20 +00:00

BasicTower has a radius of 3 blocks

This commit is contained in:
Yohann D'ANELLO 2020-02-25 11:02:01 +01:00
parent f16ecc332b
commit b97f662d70

View File

@ -34,7 +34,8 @@ public class BasicTower extends Tower {
List<Mob> filtered = new ArrayList<>();
for (Mob mob : mobs) {
if (mob.getX() == getX() || mob.getY() == getY())
if ((mob.getX() == getX() || mob.getY() == getY())
&& Math.abs(mob.getX() - getX()) <= 3 && Math.abs(mob.getY() - getY()) <= 3)
filtered.add(mob);
}