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

2017/10/18

getting active world from a world?

wolfyze wolfyze

2017/10/18

#
I basically have an infinite amount of worlds creating each other and I'd like to fix it like this:
if(activeWorld() == this){
MyWorld mw1 = new MyWorld();
}
except i need something that actually works instead of "activeWorld()" (active world as in the one on the screen)
danpost danpost

2017/10/18

#
The active world is the only one whose act method is run; so, 'this' should always be the active world.
wolfyze wolfyze

2017/10/18

#
Thank youu ill just make it create the world in act() when it runs for the first time
You need to login to post a reply.