-
-
Save zachwlewis/577791 to your computer and use it in GitHub Desktop.
The proper way to add entites to a new World in FlashPunk.
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
package | |
{ | |
import net.flashpunk.World; | |
import Master; | |
public class DungeonWorld extends World | |
{ | |
public function DungeonWorld() | |
{ | |
trace(Master.currentLevel); | |
} | |
override public function begin():void | |
{ | |
// We want to add our entities on the first tick of our new world. | |
// This prevents things from being added to the previous world. | |
add(new Level()); | |
add(new Player(50,50)); | |
} | |
override public function update():void | |
{ | |
super.update(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment