java.lang.IllegalStateException: Actor not in world. An attempt was made to use the actor's location while it is not in the world. Either it has not yet been inserted, or it has been removed.
at greenfoot.Actor.failIfNotInWorld(Actor.java:656)
at greenfoot.Actor.getOneObjectAtOffset(Actor.java:860)
at DelfinLinks.eat(DelfinLinks.java:43)
at DelfinLinks.act(DelfinLinks.java:19)
at greenfoot.core.Simulation.actActor(Simulation.java:507)
at greenfoot.core.Simulation.runOneLoop(Simulation.java:470)
at greenfoot.core.Simulation.runContent(Simulation.java:204)
at greenfoot.core.Simulation.run(Simulation.java:194)
java.lang.IllegalStateException: Actor not in world. An attempt was made to use the actor's location while it is not in the world. Either it has not yet been inserted, or it has been removed.
at greenfoot.Actor.failIfNotInWorld(Actor.java:656)
at greenfoot.Actor.getOneObjectAtOffset(Actor.java:860)
at HaiLinks.eatFischKlein1(HaiLinks.java:55)
at HaiLinks.act(HaiLinks.java:22)
at greenfoot.core.Simulation.actActor(Simulation.java:507)
at greenfoot.core.Simulation.runOneLoop(Simulation.java:470)
at greenfoot.core.Simulation.runContent(Simulation.java:204)
at greenfoot.core.Simulation.run(Simulation.java:194)
java.lang.IllegalStateException: Actor not in world. An attempt was made to use the actor's location while it is not in the world. Either it has not yet been inserted, or it has been removed.
at greenfoot.Actor.failIfNotInWorld(Actor.java:656)
at greenfoot.Actor.getOneObjectAtOffset(Actor.java:860)
at HaiLinks.eatFischKlein1(HaiLinks.java:55)
at HaiLinks.act(HaiLinks.java:22)
at greenfoot.core.Simulation.actActor(Simulation.java:507)
at greenfoot.core.Simulation.runOneLoop(Simulation.java:470)
at greenfoot.core.Simulation.runContent(Simulation.java:204)
at greenfoot.core.Simulation.run(Simulation.java:194)
Delfin.class :
DelfinRechts
public void act()
{
move();
eat();
eat2();
}
public void move()
{
int xpos = getX() + 2;
if (xpos >= 899) {
getWorld().removeObject(this);
}
else {
setLocation(xpos, getY());
}
}
public void eat()
{
Actor HaiRechts;
HaiRechts = getOneObjectAtOffset(0, 0, DelfinRechts.class);
if(HaiRechts != null)
{
World world;
world = getWorld();
world.removeObject(HaiRechts);
}
}
public void eat2()
{
Actor HaiLinks;
HaiLinks = getOneObjectAtOffset(0, 0, DelfinRechts.class);
if(HaiLinks != null)
{
World world;
world = getWorld();
world.removeObject(HaiLinks);
}
}
}
DelfinLinks
public void act()
{
move();
eat();
eat2();
}
public void move()
{
int xpos = getX() - 2;
if (xpos <= 1)
{
getWorld().removeObject(this);
}
else {
setLocation(xpos, getY());
}
}
public void eat()
{
Actor HaiRechts;
HaiRechts = getOneObjectAtOffset(0, 0, DelfinLinks.class);
if(HaiRechts != null)
{
World world;
world = getWorld();
world.removeObject(HaiRechts);
}
}
public void eat2()
{
Actor HaiLinks;
HaiLinks = getOneObjectAtOffset(0, 0, DelfinLinks.class);
if(HaiLinks != null)
{
World world;
world = getWorld();
world.removeObject(HaiLinks);
}
}
}
Hai.class:
public class HaiLinks extends Actor
{
/**
* Act - do whatever the Hai wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public void act()
{
moveAround();
eatFischKlein1();
eatFischKlein2();
eatFischOrangeRechts();
eatFischOrangeLinks();
eatFischGelbLinks();
eatFischGelbRechts();
eatSeepferdchenLinks();
eatSeepferdchenRechts();
}
public void moveAround()
{
int xpos = getX() - 2;
if (xpos <= 1)
{
getWorld().removeObject(this);
}
else {
setLocation(xpos, getY());
}
}
public void eatFischKlein1()
{
Actor FischKleinLinks;
FischKleinLinks = getOneObjectAtOffset(0, 0, HaiLinks.class);
if(FischKleinLinks != null)
{
World world;
world = getWorld();
world.removeObject(FischKleinLinks);
}
}
public void eatFischKlein2()
{
Actor FischKleinRechts;
FischKleinRechts = getOneObjectAtOffset(0, 0, HaiLinks.class);
if(FischKleinRechts != null)
{
World world;
world = getWorld();
world.removeObject(FischKleinRechts);
}
}
public void eatSeepferdchenRechts()
{
Actor SeepferdchenRechts;
SeepferdchenRechts = getOneObjectAtOffset(0, 0, HaiLinks.class);
if(SeepferdchenRechts != null)
{
World world;
world = getWorld();
world.removeObject(SeepferdchenRechts);
}
}
public void eatSeepferdchenLinks()
{
Actor SeepferdchenLinks;
SeepferdchenLinks = getOneObjectAtOffset(0, 0, HaiLinks.class);
if(SeepferdchenLinks != null)
{
World world;
world = getWorld();
world.removeObject(SeepferdchenLinks);
}
}
public void eatFischGelbLinks()
{
Actor FischGelbLinks;
FischGelbLinks = getOneObjectAtOffset(0, 0, HaiLinks.class);
if(FischGelbLinks != null)
{
World world;
world = getWorld();
world.removeObject(FischGelbLinks);
}
}
public void eatFischGelbRechts()
{
Actor FischGelbRechts;
FischGelbRechts = getOneObjectAtOffset(0, 0, HaiLinks.class);
if(FischGelbRechts != null)
{
World world;
world = getWorld();
world.removeObject(FischGelbRechts);
}
}
public void eatFischOrangeRechts()
{
Actor FischOrangeRechts;
FischOrangeRechts = getOneObjectAtOffset(0, 0, HaiLinks.class);
if(FischOrangeRechts != null)
{
World world;
world = getWorld();
world.removeObject(FischOrangeRechts);
}
}
public void eatFischOrangeLinks()
{
Actor FischOrangeLinks;
FischOrangeLinks = getOneObjectAtOffset(0, 0, HaiLinks.class);
if(FischOrangeLinks != null)
{
World world;
world = getWorld();
world.removeObject(FischOrangeLinks);
}
}
public void eat()
{
Actor Fisch;
Fisch = getOneObjectAtOffset(0, 0, HaiLinks.class);
if(Fisch != null)
{
World world;
world = getWorld();
world.removeObject(Fisch);
}
}
}
what is false i need help please

