30 if (pf.getContainingLocation() != ghost.
getEntity().getContainingLocation() || !pf.isAlive()) {
34 super.advance(amount, ghost);
41 Vector2f dir = Misc.getUnitVector(pf.getLocation(),
to.getLocation());
42 Vector2f diff = Vector2f.sub(ghost.
getEntity().getLocation(), pf.getLocation(),
new Vector2f());
44 float distAheadOfPlayer = Vector2f.dot(dir, diff);
45 float distFromPlayer = Misc.getDistance(pf, ghost.
getEntity());
46 if (distFromPlayer >= goBackThreshold) {
51 ghost.
moveTo(
to.getLocation(),
new Vector2f(), burn);
60 float dist = Misc.getDistance(ghost.
getEntity(),
to);
61 if (dist < ghost.
getEntity().getRadius() +
to.getRadius()) {