The act method in MainMenu needs:
in it with implementation for the help button to work.
if (Greenfoot.mouseClicked(btnHelp))
{
...
}if (Greenfoot.mouseClicked(btnHelp))
{
...
}if (Greenfoot.mouseClicked(btnHelp))
{
...
} public void act()
{
if(Greenfoot.mouseClicked(btnStartButton))
{
//start simulation when start button is clicked
startSimulation();
}
if (Greenfoot.mouseClicked(btnHelp))
{
//show help menu when help button is clicked
help();
}
}
private void startSimulation()
{
Greenfoot.setWorld(new BeeWorld(weatherInput.weatherValue));
}
private void help()
{
//add help menu
HelpMenu HelpMenu = new HelpMenu();
addObject (HelpMenu, getWidth(), getHeight());
HelpMenu.setLocation(650,200);
//button to be able to remove help menu
RemoveMenu RemoveMenu = new RemoveMenu();
addObject (RemoveMenu, getWidth(), getHeight());
RemoveMenu.setLocation(900,200);
}
}