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

2012/5/14

Change Worlds

KaiBB KaiBB

2012/5/14

#
How would I change the world you're viewing? Like, if I had a platformer, and the level changed when you reach the end of the current level.
danpost danpost

2012/5/14

#
Check the discussion on Switching between worlds .
IsVarious IsVarious

2012/5/14

#
Well, you could do it that way, or just have a new method called, which populates the world/level as you want, and every time it reaches the end of that level, it calls a new method. You could keep track of certain things like life, time, when an actor is in a certain place, and if those conditions are met, it loads a method that populates the world in a new way. Or just write new world classes, and switch between them with this line of code... Greenfoot.setWorld(new Level2()); where level2 is the name of the new level you want to switch to. also you can check this link out... Level Tutorial in Greenfoot
You need to login to post a reply.