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
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.
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.