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

2011/5/30

Move to another world

RedTurbo5 RedTurbo5

2011/5/30

#
Sorry I'm Newbie, I want to know if I want to move from a class in a world to another class in the world, what code I must use ? ex: If the actor move into castle so the actor will be inside the castle
MrCohen MrCohen

2011/6/1

#
As far as I know, there is no direct way of doing this (yet). You have to do it manually. You need to change your world's image, remove objects from the "outdoor" world and populate it with objects for your "castle." You should never have more than one subclass or World. According to a discussion on the teacher forum, there is a new version of Greenfoot coming out in the near future that will accommodate multiple World sub-classes.
nccb nccb

2011/6/1

#
Greenfoot 2.1.0 is due out in the next week, and will feature the ability to change the world (heh!). There will be a Greenfoot.setWorld(world) method which will allow you to change the world mid-execution, which we hope will be useful for these sorts of level changes.
You need to login to post a reply.