I've tested the following code and for someone reason each click counts twice (once for the press and once for the release). Can someone tell me why this is happening so I can prevent it? Thanks in advance!
MouseInfo info = Greenfoot.getMouseInfo();
if(info != null && info.getButton() == 1){ //mouse click detected
if(startButton.isSelected(info.getX(), info.getY())){ //start button was clicked
startButton.execute();
}
else if(helpButton.isSelected(info.getX(), info.getY())){ //help button was clicked
helpButton.execute();
}
}
