Is there a way to make a variable accessible from all other classes and worlds? I am making a security protocol for an app that I'm making. It requires one to register with a password using one actor, and then another actor asks to enter the password so that they can verify it. I would like to make an if statement which compares these two variable, but since they are defined in different places I cannot seem to do it.
This is basically what the if statement looks like at the moment:
Bare in mind passwordmatch1 and password are both integer variables and they have both been defined in different actors.
Also both passwordmatch1 and password were defined in two different if statements. May this cause a problem?
Thanks
if(passwordmatch1 == password)
{
Greenfoot.setWorld(new ChipRider_SingleTicketBuy());
}
else
{
Greenfoot.setWorld(new ChipRider_Retry());
}

