does anyone know how to make the terminal window stop appearing? there have been plenty of times wherein my program stops because of it :-(
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:711) at greenfoot.Actor.getY(Actor.java:177) at L.act(L.java:26) at greenfoot.core.Simulation.actActor(Simulation.java:604) at greenfoot.core.Simulation.runOneLoop(Simulation.java:562) at greenfoot.core.Simulation.runContent(Simulation.java:221) at greenfoot.core.Simulation.run(Simulation.java:211)
public class L extends Actor
{
public L()
{ //this is to resize the image
GreenfootImage image = getImage();
image.scale(330, 150);
}
public void act()
{
{
setLocation (getX(), getY()+6);
if (Greenfoot.isKeyDown("l"))
{
getWorld().removeObject(this); // removing L actor on 'l' press
Greenfoot.playSound("poppy.wav");// playing 'pop' when L actor is removed
}
}
if (getY() == getWorld().getHeight()-1)
{
((bg)getWorld()).gameOver();
return;
}
}
}