Hi @ all!
I'm completely new to green foot, just started one week ago and I want to make a little game.
So you are a fish and eat other fishes, the "dead" fish should change to a bloodstain and move to the left side, just as the normal fish would have done, if you wouldn't have eaten it.
So my code works, but not replacing the fish object with the bloodstain object. And the fish shouldn't just change image, because then you would still be able to kill it. I want it to be an object, that just does nothing expect leaving the screen like the normal fish.
Here is my code:
public void eat()
// kills every eatable fish
{
Actor fish;
fish = getOneObjectAtOffset (0,0, Fishes.class);
if (fish != null)
{
World world;
world = getWorld();
Waterworld waterworld = (Waterworld)world;
Counter counter = waterworld.getCounter();
counter.addScore();
world.removeObject (fish);
BloodStain bloodstain = new BloodStain();
world.addObject (bloodstain);
fishEaten++;
Greenfoot.playSound("BloodSplatter.mp3");
}
}
PLEASE help me, I couldn't find a solution and I have no idea. Maybe you could write the code.
Thank you for any help! :)

