I have made my Greeps turn at the edges of the world and the water. However, when a Greep is loaded with a tomato, it will get stuck at the water's edge. It is driving me crazy. I know this ic competition for some, but it is a final project for me and I have tried all I know (or recall). I put my method here. Can you see what is wrong? Why would a tomato make a difference?
Here is a bit of my act method
/**
* Water edge? Go another direction!
*/
public void checkWater()
{
if (atWater())
{
turn(180);
move();
}
} public void act()
{
super.act(); // do not delete! leave as first statement in act().
if (carryingTomato()) {
if(atShip()) {
dropTomato();
}
else {
turnHome();
move();
checkEdge();
checkWater();
}
}