daily pastebin goal
4%
SHARE
TWEET

Untitled

a guest Jun 14th, 2018 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Master.as
  2.  
  3. package  
  4. {
  5.     public class Master
  6.     {
  7.         public static var levelData:Vector.<DungeonWorld>;
  8.         public static var currentLevel:uint = 0;
  9.        
  10.        
  11.         public function Master()
  12.         {
  13.            
  14.         }
  15.        
  16.     }
  17.  
  18. }
  19.  
  20.  
  21. //DungeonWorld.as
  22.  
  23. package
  24. {
  25.     import net.flashpunk.*;
  26.     import Master;
  27.  
  28.     public class DungeonWorld extends World
  29.     {
  30.        
  31.         public function DungeonWorld()
  32.         {
  33.             trace(Master.currentLevel);
  34.         }
  35.        
  36.         override public function begin():void
  37.         {
  38.             add(new Level());
  39.             add(new Player(FP.screen.width/2,FP.screen.height/2));
  40.         }
  41.        
  42.         override public function end():void
  43.         {
  44.             Master.levelData.push(this);
  45.             Master.currentLevel++;
  46.             super.end();
  47.         }
  48.     }
  49.  
  50. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top