From 9abd235ed2b9a5c80d5e63d6187d69e9317c2f0d Mon Sep 17 00:00:00 2001 From: Indrajith K L Date: Wed, 22 Sep 2021 10:10:50 +0530 Subject: * Initial Commit * Leaderboard Implementation for dreamlo * FlxSave for Player Data * GUID Generation for Unique User --- source/PlayState.hx | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 source/PlayState.hx (limited to 'source/PlayState.hx') diff --git a/source/PlayState.hx b/source/PlayState.hx new file mode 100644 index 0000000..593c32f --- /dev/null +++ b/source/PlayState.hx @@ -0,0 +1,33 @@ +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); + } +} -- cgit v1.2.3