Hi! I'm like some help on making an object delete itself after reaching the end of the world.
Here is my code so far:
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* Write a description of class Gold_Ball here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class Gold_Ball extends Actor
{
/**
* Act - do whatever the Gold_Ball wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public void act()
{
move(4);
if(isAtEdge()){
//what do I do here
}
}
}

