Okay, thanks. And yeah, the return thing makes sense, I don't know why I didn't get it sooner lol, anyway. when I removed the "return" by the end of 8 line, I could click on everything and it would be gone. So that fixed something. Also, I need to get the .getValue() code to be able to compare classes? And am I supposed to get int aswel? I don't know what am I supposed to do else, it keeps saying "cannot find method" or something with boolean and "incomparible types". I don't know what to do with line 15, I understand to compare the classes but I don't know which code should I use to properly compare them and if they match, they're gone. And yes, my mistake about the removeObjects and adding them. I was trying the code to work and I put them under the comment, I wasn't paying enough attention and deleted them. But still it should remove one of them, right? Anyway, the code is this:
private Actor firstClick;
// Monkey m1 = new Monkey(); these are defined at the very beggining
// Banana b1 = new Banana();
public void act()
{
if (Greenfoot.mouseClicked(null))
{
MouseInfo mouse = Greenfoot.getMouseInfo();
Actor mouseActor = mouse.getActor();
if (mouseActor == null || mouseActor instanceof Banana);
removeObject(b1);
if ( firstClick == null)
{
firstClick = mouseActor;
}
if ( code )
{
removeObject(m1);
removeObject(b1);
}
else
{
addObject(m1, 671, 89);
addObject(b1,216, 324);
}
firstClick = null;
}
}

