I am working on the crab game and i have to make my crabs look for worms. I have an error at “public void lookForWorm()” and the error says “illegal start of expression”. What do i have to do?
This is what i have
public void act()
{
If ( isAtEdge() )
{
turn(45);
If ( Greenfoot.getRandomNumber(100) < 10 )
{
turn(15);
}
move(5);
lookForWorm();
public void lookForWorm()
{
if ( isTouching(Worm.class) )
{
removeTouching(Worm.Class);
}