Hi again,
in my project, the Lemon should disappear as soon as it reaches the end of the world. However, my code does not work that way. What did I do wrong?
public class Lemon extends Actor
{
/**
*
*/
public Lemon()
{
turn(90);
}
/**
* Act - do whatever the Lemon wants to do. This method is called whenever the 'Act' or 'Run' button gets pressed in the environment.
*/
public void act()
{
move(4);
Actor mädchen = getOneIntersectingObject(Mädchen.class);
if (mädchen!=null)
{
Counter counter = new Counter();
((MyWorld)getWorld()).getCounter().addScore();
}
}
public boolean atWorldEdge()
{
if (atWorldEdge())
{
getWorld().removeObjects(getWorld().getObjects(Lemon.class));
}
{
return Lemon.class;
}
}
}

