本文整理汇总了C#中IGame.Init方法的典型用法代码示例。如果您正苦于以下问题:C# IGame.Init方法的具体用法?C# IGame.Init怎么用?C# IGame.Init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IGame
的用法示例。
在下文中一共展示了IGame.Init方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MainWindow
public MainWindow()
{
InitializeComponent();
WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen;
Application.Current.MainWindow.WindowState = WindowState.Maximized;
this.PreviewKeyDown += new KeyEventHandler(HandleKeyEvent);
double heightscale = 1;
double widthscale = 1;
if(ColorTouchGrid_GameTable.Rows > ColorTouchGrid_GameTable.Columns)
{
widthscale = 1 / (double)ColorTouchGrid_GameTable.Rows * (double)ColorTouchGrid_GameTable.Columns;
}
else
{
heightscale = 1 / (double)ColorTouchGrid_GameTable.Columns * (double)ColorTouchGrid_GameTable.Rows;
}
Grid_Main.Width = (SystemParameters.PrimaryScreenHeight * 0.9 * widthscale);
Grid_Main.Height = (SystemParameters.PrimaryScreenHeight * 0.9 * heightscale);
_Game = new Tetris();
_Game.Init(ColorTouchGrid_GameTable.Rows, ColorTouchGrid_GameTable.Columns);
_Watch.Start();
CompositionTarget.Rendering += Game_Loop;
}
示例2: ComboBox_SelectionChanged
private void ComboBox_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
{
switch ((string)((ComboBoxItem)((ComboBox)sender).SelectedValue).Content)
{
case "Tetris":
_Game = new Tetris();
_Game.Init(ColorTouchGrid_GameTable.Rows, ColorTouchGrid_GameTable.Columns);
break;
default:
_Game = null;
break;
}
}