Hello, i have a problem, i wrote a code that is suppsed to work, but i cant find my mistake.
I have a caracter on name:man in the World:Home, and when I click on the caracter:man I want the game to take me to world:MyWorld and I want the character man to appear there.
My code is here:
public void act()
{
if(Greenfoot.mouseClicked(this)){addedToWorld();}
}
public void addedToWorld()
{ World MyWorld = new MyWorld();
Greenfoot.setWorld(new MyWorld());
getWorld().addObject(new man(),200,330);
}
The game sends me to the wolrd:MyWorld but the caracter:man wont apear there.
Can u help me with the problem? I would be thankful.