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

2013/11/14

a little assistance...

payner2013 payner2013

2013/11/14

#
 if (getWorld().getObjects(Rock.class).isEmpty())
        {
          Greenfoot.setWorld(new Space1());
now obviously when it gets to Space1, and it completes that level it will start it again. is there a way i can use this method and do something along the lines of: getWorld(Space1) ......... ?
danpost danpost

2013/11/15

#
You can use:
Space1 space1 = (Space1)getWorld();
before line 3 to get the current Space1 world; and, after line 3 to get the new Space1 world.
payner2013 payner2013

2013/11/16

#
ok thank you
danpost danpost

2013/11/16

#
I got ahead of myself on the 'new Space1 world' part. You need to set the new Space1 world with the following:
Space1 space1 = new Space1();
Greenfoot.setWorld(space1);
to reference the new Space1 world.
payner2013 payner2013

2013/11/18

#
ahhh ok.. im taking my time replying cuz i thought i was getting on peoples nervs... haha thank you
You need to login to post a reply.