This site requires JavaScript, please enable it in your browser!
Greenfoot back
Lethal_Vitamin
Lethal_Vitamin wrote ...

2013/12/8

World Swappin'

Lethal_Vitamin Lethal_Vitamin

2013/12/8

#
My Scenario I am trying to change the world like in The Legend of Zelda. Absolutely no more ideas why this approach doesn't work.
danpost danpost

2013/12/8

#
After creating the new world you use 'getWorld' (which refers to the world that the actor is currently in -- the 'old' world). You need to refer to the new world to 'addObject' into it:
UpperWorld uw = new UpperWorld();
uw.addObject(this, getX(), uw.getHeight()-1);
Greenfoot.setWorld(uw);
Lethal_Vitamin Lethal_Vitamin

2013/12/8

#
*facepalm*
You need to login to post a reply.