Heyy, sorry for a noob problem. But i got some problem with removing an object.
I want to create a notification error such as "WRONG!" to appears after clicking an actor and disappear soon after it. But, in my scenario whenever i click the actor the notif is working but it just wont to be disappear.
Superclass:
Subclass:
public void act()
{
}
public void wrong()
{
Wrong1 Wrong1 = new Wrong1();
getWorld().addObject(new Wrong1(),300,200);
Greenfoot.delay(5);
getWorld().removeObject(Wrong1);
} public void act()
{
if(Greenfoot.mouseClicked(this))
{
wrong();
}
}