Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Main Menu
- // MenuState.hx
- package;
- import flixel.FlxG;
- import flixel.FlxState;
- import flixel.text.FlxText;
- import flixel.ui.FlxButton;
- class MenuState extends FlxState
- {
- var playButton:FlxButton;
- var menuText:FlxText;
- override public function create()
- {
- super.create();
- playButton = new FlxButton(100, 100, "Play", clickPlay);
- menuText = new FlxText(100, 100, 0, "Main Menu", 46);
- add(playButton);
- add(menuText);
- }
- function clickPlay()
- {
- FlxG.switchState(new PlayState());
- }
- override public function update(elapsed:Float)
- {
- super.update(elapsed);
- }
- }
- // PlayState.hx
- package;
- import flixel.FlxState;
- import flixel.text.FlxText;
- class PlayState extends FlxState
- {
- var playText:FlxText;
- override public function create()
- {
- super.create();
- playText = new FlxText(500, 500, "Play Menu", 64);
- playText.screenCenter();
- add(playText);
- }
- override public function update(elapsed:Float)
- {
- super.update(elapsed);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement