// Настройка кнопки старт private void Startbutton_Click(object sender, EventArgs e) { startingform.Hide(); Form gameform = new Form { Width = 1080, Height = 720, Text = "Asteroids Game", Icon = new System.Drawing.Icon("Assets/32х32.ico") }; Game.Init(gameform); Game.Draw(); gameform.ShowDialog(); }
static void Main(string[] args) { Form form = new Form(); form.Width = 800; form.Height = 600; Game.Init(form); form.Show(); Game.Load(); Game.Draw(); Application.Run(form); }
/// <summary> /// Метод, отвечающий за логику нажатия на кнопку "Новая игра", открывает новое окно с классом Game /// </summary> public static void FormGame() { Form formGame = new Form { StartPosition = FormStartPosition.CenterScreen, Width = 800, Height = 600 }; void NewGame_Click(object sender, EventArgs e) { form1.Hide(); Game.Init(formGame); formGame.ShowDialog(); form1.Close(); Game.Draw(); } newGame.Click += NewGame_Click; }
public static void Main(string[] args) { var form = new Form { Width = 1000, Height = 800 }; try { Game.Init(form); form.Show(); Game.Draw(); Application.Run(form); } catch (Exceptions.CustomException ex) { MessageBox.Show(ex.Message, "Ошибка!"); Application.Exit(); } }
static void Main(string[] args) { Form form = new Form(); form.Width = 800; form.Height = 600; // Game.Init(form); // form.Show(); // Game.Draw(); // Application.Run(form); // Form form = new Form // { // Width = Screen.PrimaryScreen.Bounds.Width, // Height = Screen.PrimaryScreen.Bounds.Height // }; Game.Init(form); form.Show(); Game.Load(); Game.Draw(); Application.Run(form); }