package screens; import flixel.FlxG; import flixel.FlxSprite; import flixel.FlxState; import shared.PlayerSave; import shared.UserNamePopup; class RegisterPlayerState extends FlxState { override public function create() { super.create(); var bg = new FlxSprite(0, 0, AssetPaths.space_bg__png); var popup = new UserNamePopup(OnSave); add(bg); add(popup); } function OnSave(data:PlayerSave) { if (data != null) { FlxG.switchState(new MenuState()); } } }