Basically when my mouse is over an image of a target I want to be able to click and remove the target. Any help would be appreciated, thanks.
if (Greenfoot.mouseClicked(this)) {
World world;
world = getWorld();
world.removeObject(this);
return;
} public void act()
{
removeOnClick();
}
public void removeOnClick()
{
if (Greenfoot.mouseClicked(this)) {
World world;
world = getWorld();
world.removeObject(this);
return;
}
}
if (Greenfoot.mouseClicked(this))
if (Greenfoot.mouseClicked(null))
if (Greenfoot.mouseClicked(null) && !getIntersectingObjects(Aim.class).isEmpty()) ...
if (Greenfoot.mouseClicked(null) && !getIntersectingObjects(Aim.class).isEmpty()) ...
if (Greenfoot.mouseClicked(null) && !getObjectsAtOffset(0, 0, Aim.class).isEmpty()) ...