i have the following code, and i want to make it so that when i am on level 1 it asks the level 1 question, and if i am on level 2 it asks the level 2 question etc.
public void question()
{
if (canSee(portal.class))
{
String name =JOptionPane.showInputDialog("what does RAM stand for");
if (name.matches("random access memory"))
{
Greenfoot.setWorld(new labarynth2());
}
else
{
lives--;
Greenfoot.setWorld(new labarynth());
}
}
}
can anyone help?
