aboutsummaryrefslogtreecommitdiff
path: root/source/PlayState.hx
blob: 593c32f6883fd2d6df6854052491bd09f5762024 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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);
	}
}