本文整理汇总了C#中MenuState.Reset方法的典型用法代码示例。如果您正苦于以下问题:C# MenuState.Reset方法的具体用法?C# MenuState.Reset怎么用?C# MenuState.Reset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MenuState
的用法示例。
在下文中一共展示了MenuState.Reset方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
static void Main(string[] args)
{
MenuState startMenu = new MenuState("MineEscape", "\n\nRobert Rouhani, Craig Carlson, Domenic Cristaldi\n\nRPI Game Dev Club Gamejam 10/27/2012\n\n\n\nPress any key to continue...");
MenuState objectiveMenu = new MenuState("Objective", "\nA miner has accidentally unleashed an evil force deep in the mines.\nYou are the lone survivor who must escape the cave.\nFind the generator to activate power for the floor.\nEscape through the lift.\n\n\n\nPress any key to continue...");
MenuState controlsMenu = new MenuState("Controls", "\nWASD to move\n\nE to interact\n\nEsc to quit\n\n\nPress any key to continue...");
startMenu.OnPopped +=
(s, e) =>
{
startMenu.Reset();
StateManager.PushState(startMenu); //reset and loop
StateManager.PushState(objectiveMenu);
};
objectiveMenu.OnPopped +=
(s, e) =>
{
StateManager.PushState(controlsMenu);
};
controlsMenu.OnPopped += (s, e) => StateManager.PushState(new GameState(1));
StateManager.PushState(startMenu);
using (var window = new EscapeGameWindow())
{
window.Run();
}
}