Skip to content

Instantly share code, notes, and snippets.

@sjakaus
Created September 14, 2010 18:28
Show Gist options
  • Save sjakaus/579517 to your computer and use it in GitHub Desktop.
Save sjakaus/579517 to your computer and use it in GitHub Desktop.
//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