static void Main(string[] args) { 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); }
static void Main() { Form form = new Form { Width = 800, Height = 600 }; Game.Init(form); form.Show(); Game.Load(); Game.Draw(); Application.Run(form); }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Form gameForm = new Form(); gameForm.Show(); gameForm.Width = 800; gameForm.Height = 600; Game.Initialize(gameForm); Game.Load(); Game.Draw(); Application.Run(gameForm); }
static void Main(string[] args) { try { Console.WriteLine("Please, enter game window width"); int.TryParse(Console.ReadLine(), out int width); Console.WriteLine("Please, enter game window height"); int.TryParse(Console.ReadLine(), out int height); Form form = new Form() { Width = width, Height = height }; Game.Init(form); form.Show(); Game.Load(); Game.Draw(); Application.Run(form); } catch (Exception e) { MessageBox.Show(e.Message); } }
static void Main(string[] args) { var form = new Form { Width = Screen.PrimaryScreen.Bounds.Width, Height = Screen.PrimaryScreen.Bounds.Height }; try { Game.Init(form); } catch (ArgumentOutOfRangeException e) { form.Width = 800; form.Height = 600; Game.Init(form); } Game.Load(); form.Show(); Game.Draw(); Application.Run(form); }