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.


1 2 3 4 5 6 | if (Greenfoot.mouseClicked( this )) { World world; world = getWorld(); world.removeObject( this ); return ; } |
1 2 3 4 5 6 7 8 9 10 11 12 13 | public void act() { removeOnClick(); } public void removeOnClick() { if (Greenfoot.mouseClicked( this )) { World world; world = getWorld(); world.removeObject( this ); return ; } } |
1 | if (Greenfoot.mouseClicked( this )) |
1 | if (Greenfoot.mouseClicked( null )) |
1 | if (Greenfoot.mouseClicked( null ) && !getIntersectingObjects(Aim. class ).isEmpty()) ... |
1 | if (Greenfoot.mouseClicked( null ) && !getIntersectingObjects(Aim. class ).isEmpty()) ... |
1 | if (Greenfoot.mouseClicked( null ) && !getObjectsAtOffset( 0 , 0 , Aim. class ).isEmpty()) ... |