public void tick() { // update mobs and if they are using AI, check to see if the player is visible to them for (Mob e : mobList) { e.tick(); } Point2D p = Globals.getIsoCoords(player.getX(), player.getY()); Camera.moveTo((int) p.getX(), (int) p.getY()); }
public Entity getEntityCollision(Shape s, Mob caller) { Mob deadMob = null; Mob friendMob = null; for (Mob e : mobList) { if (e == null) continue; if (e == caller) continue; if (e.playerFriend) continue; if (s.intersects(e.getAttbox())) { if (e.isAlive()) return e; else if (e.playerFriend) friendMob = e; else deadMob = e; } } if (deadMob != null) return deadMob; else if (friendMob != null) return friendMob; return null; }