I wrote this code, to make the actor follow my mouse:
private int mausY=0;
private int mausX=0;
private int button= false;
public void drehenZurMaus(){
MouseInfo maus = Greenfoot.getMouseInfo();
if(maus!=null){
MouseInfo button == maus.getButton();
if(button == 1 && Greenfoot.mouseClicked(null))
{
mausX=maus.getX();
mausY=maus.getY();
turnTowards(mausX, mausY);
move();
}
}
}
But in this line:
MouseInfo button == maus.getButton();
there is a ; expected between button and ==
Whats the problem with this?

