Skip to content

Commit

Permalink
Small refactor to make things clear during startup
Browse files Browse the repository at this point in the history
  • Loading branch information
Dovyski committed Oct 5, 2018
1 parent 6a8c8b7 commit 15e59b5
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions flixel/addons/studio/FlxStudio.hx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class FlxStudio extends flixel.system.debug.Window
public var entitiesLockButtonClicked:FlxSignal = new FlxSignal();

// TODO: choose a good name for this
public static function bootstrap():Void
public static function start():Void
{
FlxStudio.instance = new FlxStudio();
}
Expand All @@ -61,8 +61,19 @@ class FlxStudio extends flixel.system.debug.Window
public function new()
{
super("FlxStudio");

visible = false;

// Initialize everything only after the game has been started, that way
// we have access to all element added during the game's `create()` call.
// It allows developers to call `FlxStudio.start()` at any point.
FlxG.signals.gameStarted.add(bootstrap);
}

/**
* TODO: add docs
*/
function bootstrap():Void
{
_properties = new Properties();
_entities = new Entities();

Expand Down

0 comments on commit 15e59b5

Please sign in to comment.