Created
September 14, 2010 18:28
-
-
Save sjakaus/579517 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Master.as | |
package | |
{ | |
public class Master | |
{ | |
public static var levelData:Vector.<DungeonWorld>; | |
public static var currentLevel:uint = 0; | |
public function Master() | |
{ | |
} | |
} | |
} | |
//DungeonWorld.as | |
package | |
{ | |
import net.flashpunk.*; | |
import Master; | |
public class DungeonWorld extends World | |
{ | |
public function DungeonWorld() | |
{ | |
trace(Master.currentLevel); | |
} | |
override public function begin():void | |
{ | |
add(new Level()); | |
add(new Player(FP.screen.width/2,FP.screen.height/2)); | |
} | |
override public function end():void | |
{ | |
Master.levelData.push(this); | |
Master.currentLevel++; | |
super.end(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment