Mate attraction and predator avoidance