Initial main menu impl

This commit is contained in:
2021-04-23 15:07:50 +02:00
parent 05657b14dd
commit 44f0f9e399
10 changed files with 91 additions and 38 deletions
+34
View File
@@ -0,0 +1,34 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using EvilSatellites.Menu;
using EvilSatellites.Screens;
namespace EvilSatellites.Screens
{
public class MainMenuScreen : MenuScreen
{
public override void Activate()
{
MenuOptions = new MenuContainer("Main Menu", "Navigate with up and down arrows,, and enter to select.");
MenuOptions.Add(new MenuEntry("Start", "Start the game"))
.Add(new MenuEntry("Exit", "Exit the game"))
.Add(new MenuEntry("Something Else", "Do something else"));
base.Activate();
}
public override void SelectItem()
{
Manager.Sound.PlayOneshot(@"sfx/ui/menuChoose.wav");
if (CursorPosition == 0)
{
Manager.AddScreen(new GameScreen());
Manager.RemoveScreen(this);
Manager.Game.ResetElapsedTime();
}
}
}
}