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

2016/5/18

How do I load another world after certain actors dissapear?

bjornjulian00 bjornjulian00

2016/5/18

#
I am trying to get the world to change from Level1 to Level2 when three actors, Asteroid, UFO, and Missile, are no longer present. How would I manage this?
danpost danpost

2016/5/19

#
In Level1 act method, add this line:
if (getObjects(Asteroid.class).isEmpty() && getObjects(UFO.class).isEmpty() && getObjects(Missile.class).isEmpty()) Greenfoot.setWorld(new Level2());
You need to login to post a reply.