This site requires JavaScript, please enable it in your browser!
Greenfoot back
redstonespectre
redstonespectre wrote ...

2017/10/1

How To Make Something disappear when It hits the world edge?

redstonespectre redstonespectre

2017/10/1

#
How can i do this ( and where do i put this, in the actor that disappears, or in another actor)?
Super_Hippo Super_Hippo

2017/10/1

#
Put it into the act method of the actor's class code which should disappear.
public void act()
{
    //doing whatever...
    
    if (isAtEdge()) getWorld().removeObject(this);
}
You need to login to post a reply.