Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class OuterWorld
- {
- List<InnerWorld> houses
- override initialize()
- {
- houses = new List<InnerWorld>()
- construct each house, set the world = this on each one
- }
- override update()
- {
- foreach house:
- if player is inside the zone:
- FlxG.state = house
- }
- }
- class InnerWorld
- {
- Rectangle zone
- OuterWorld world
- public InnerWorld(OuterWorld world) { this.world = world; }
- override update()
- {
- if the player is at the exit:
- FlxG.state = world;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement