// i want to insert b2 with with b1 but i will error
if (Greenfoot.mouseClicked(b1)) {
getWorld().removeObject(this);
}
if (Greenfoot.mouseClicked( b1 , b2 )) {
getWorld().removeObject(this);
}
// i want to insert b2 with with b1 but i will error
if (Greenfoot.mouseClicked(b1)) {
getWorld().removeObject(this);
}
if (Greenfoot.mouseClicked( b1 , b2 )) {
getWorld().removeObject(this);
}
// with field
private byte clickValue;
// action
if (Greenfoot.mouseClicked(b1)) clickValue |= 1; // clickValue ORed with 1 (Note: 1 OR 1 = 1)
if (Greenfoot.mouseClicked(b2)) clickValue |= 2;
if (clickValue == 3) // 1 | 2 = 3 (1 OR 2 = 3)
{
getWorld().removeObject(b1);
getWorld().removeObject(b2);
}