Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class OuterWorld
  2. {
  3.     List<InnerWorld> houses
  4.  
  5.     override initialize()
  6.     {
  7.         houses = new List<InnerWorld>()
  8.         construct each house, set the world = this on each one
  9.     }
  10.  
  11.     override update()
  12.     {
  13.         foreach house:
  14.             if player is inside the zone:
  15.                 FlxG.state = house
  16.     }
  17. }
  18.  
  19. class InnerWorld
  20. {
  21.     Rectangle zone
  22.     OuterWorld world
  23.  
  24.     public InnerWorld(OuterWorld world) { this.world = world; }
  25.  
  26.     override update()
  27.     {
  28.         if the player is at the exit:
  29.             FlxG.state = world;
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement