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/screens/MenuState.hx | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 source/screens/MenuState.hx (limited to 'source/screens/MenuState.hx') diff --git a/source/screens/MenuState.hx b/source/screens/MenuState.hx new file mode 100644 index 0000000..9f4deda --- /dev/null +++ b/source/screens/MenuState.hx @@ -0,0 +1,31 @@ +package screens; + +import flixel.FlxG; +import flixel.FlxState; +import flixel.ui.FlxButton; +import shared.PlayerSave; + +class MenuState extends FlxState +{ + public function new() + { + super(); + var playButton = new FlxButton(FlxG.width / 2 - 40, FlxG.height / 2, "Play", onPlayButtonPressed); + var leaderBoardButton = new FlxButton(FlxG.width / 2 - 40, FlxG.width / 2 + 30, "Leaderboard", onLeaderBoardButtonPressed); + add(playButton); + add(leaderBoardButton); + trace(PlayerSave.instance.guid); + } + + override public function create() + { + super.create(); + } + + function onPlayButtonPressed() {} + + function onLeaderBoardButtonPressed() + { + FlxG.switchState(new LeaderBoardState()); + } +} -- cgit v1.2.3