So I am having trouble with trying to detect if an actor is intersecting another one of itself in the world class. If you see on the code I am making several of them with respects to I. The only problem is that I am getting the error can not find symbol method getoneintersectingobject. I do not understand what is wrong.
public AnimalWorld()
{
super(600, 400, 1);
for(int i = 0; i < 30; i++)
{
xPosition = Greenfoot.getRandomNumber(580) + 10;
yPosition = Greenfoot.getRandomNumber(360) + 10;
if (i==0)
{
Actor animal = new Animal();
addObject(animal, xPosition, yPosition);
}
else if(i > 0 && i < 15)
{
Actor leaf = new Leaf();
addObject(leaf, xPosition, yPosition);
}
else if(i > 15 && i < 25)
{
Actor obstacle = new Obstacle();
addObject(obstacle, xPosition, yPosition);
Greenfoot.getOneIntersectingObjects(Obstacle.class);
if (getOneInterectingObject == null)
{
}
else
{
getWorld().removeObject(this);
getworld().addObject(obstacle, xPosition, yPosition);
}
}
else
{
Actor bomb = new Bomb();
addObject(bomb, xPosition, yPosition);
}
}
}



