Hi,
I am a total fail at programming, and i have to learn something so i can pass my class.
I am stuck i this CrabWorld were i have to make a method that will return the number of worms, my crab has eaten.
public class Crab extends Animal
{
public void act()
{
moveAndTurn();
eat();
}
public void moveAndTurn()
{
move(4);
if (Greenfoot.isKeyDown("left"))
{
turn(-3);
}
if (Greenfoot.isKeyDown("right"))
{
turn(3);
}
}
public void eat()
{
Actor worm;
worm = getOneObjectAtOffset(0, 0, Worm.class);
if (worm != null)
{
World world;
world =getWorld();
world.removeObject(worm);
}
}
}
so far this is what the crab looks like, i don't know if everything is right, but the crab is moving and eating. now i just need to see how many worms..
Please i need help... and please easy on the java-language, i started java 2 weeks ago. :O)

