I am trying to make it so that when my actor hits a specific object, it loads a new world depending the current score - a counter. I am trying to do this in the following code, but i realize i cannot compare a counter to an integer (counter <=10). Could anyone possibly help me how the code should look? thanks a lot :)
I am referencing a previously made counter, as well as a new world thats called WInScreen1
public void act()
{
Labyrinth LabWorld = (Labyrinth) getWorld();
Counter counter = LabWorld.getCounter();
Win1();
}
private boolean WinScreen1()
{
if (counter <= 10)
{
return true;
}
else
{
return false;
}
}
public void Win1()
{
Actor ditzel;
ditzel = getOneObjectAtOffset(0,0, Ditzel.class);
if (ditzel != null)
{
if(Winscreen1 = true)
{
World world;
world = getWorld();
world.removeObject(ditzel);
Greenfoot.setWorld(new WinScreen1());
}
}
}
}
