I'm having an issue with getting my zombie class to follow the character when he sees him. The zombie isn't registering either of the variable as true, even when it seems he is within the correct distance.
In a different method-
public void moveTowardsCharacter(){ if(getOneObjectAtOffset(50, 0, Platform.class) != null){ foundCharacterR = true; }else{ foundCharacterR = false; } if(getObjectsAtOffset(-50, 0, Character.class) != null){ foundCharacterL = true; }else{ foundCharacterL = false; } }
if(foundCharacterL || foundCharacterR){ if(foundCharacterL){ setLocation (getX() - 4, getY()); } if(foundCharacterR){ setLocation (getX() + 4, getY()); }