Files

44 lines
1.2 KiB
C#
Raw Permalink Normal View History

2021-04-23 15:07:50 +02:00
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"))
2021-04-23 21:08:37 +02:00
.Add(new MenuEntry("Options", "Change game options"))
.Add(new MenuEntry("Exit", "Exit the game"));
2021-04-23 15:07:50 +02:00
base.Activate();
}
public override void SelectItem()
{
2021-04-23 21:08:37 +02:00
base.SelectItem();
2021-04-23 15:07:50 +02:00
if (CursorPosition == 0)
{
Manager.AddScreen(new GameScreen());
Manager.RemoveScreen(this);
Manager.Game.ResetElapsedTime();
}
2021-04-23 21:08:37 +02:00
if (CursorPosition == 2)
{
Environment.Exit(0);
}
if (CursorPosition == 1)
{
Manager.RemoveScreen(this);
Manager.AddScreen(new OptionsScreen());
}
2021-04-23 15:07:50 +02:00
}
}
}