Hi,i want to make a Sokoban game.I want to make it with multipke level,but just in 1 world,so when the player reaches the door,all object in first level removed and replaced by all object in second level.Pkease help me T.T ..
private int level = 1;
public WorldName()
{
super(x,y,cs); //your values
prepare();
}
public void prepare()
{
switch(level)
{
case 1:
//add all objects for level 1
break;
case 2:
//add all objects for level 2
break;
//and so on
}
}
public void nextLevel()
{
removeObjects(null); //remove all objects from the world
level++;
prepare();
}//in Player class
if (isTouching(Door.class))
{
((WorldName)getWorld()).nextLevel();
}