package; import flixel.FlxG; import flixel.FlxState; import flixel.util.FlxSave; import screens.MenuState; import screens.RegisterPlayerState; import shared.PlayerSave; class PlayState extends FlxState { var saveData:FlxSave = new FlxSave(); override public function create() { super.create(); saveData.bind("PlayerSaveObj"); if (saveData.data.playerSaveObj == null) { FlxG.switchState(new RegisterPlayerState()); } else { PlayerSave.instance.setPlayerData(saveData.data.playerSaveObj.name, saveData.data.playerSaveObj.guid); FlxG.switchState(new MenuState()); } } override public function update(elapsed:Float) { super.update(elapsed); } }