static public void NewGame()
        {
            Form form = new Form();

            form.Width  = 800;
            form.Height = 600;
            Game.Init(form);
            form.Show();
            Game.Draw();
        }
示例#2
0
        private void button1_Click(object sender, EventArgs e)
        {
            Form form = new FormGame();

            form.Width  = 1000;
            form.Height = 600;
            Game.Init(form);
            form.ShowDialog();
            Application.Run(form);
        }
示例#3
0
        static void Main()
        {
            Form form = new Form();

            form.Width  = 800;
            form.Height = 600;
            Game.Init(form);
            form.Show();
            Game.Draw();
            Application.Run(form);
        }
示例#4
0
        static void Main(string[] args)
        {
            Form form = new Form();

            form.Width  = Screen.PrimaryScreen.Bounds.Width;
            form.Height = Screen.PrimaryScreen.Bounds.Height;

            Game.Init(form);
            Game.Load();
            form.Show();
            Game.Draw();
            Application.Run(form);
        }
示例#5
0
文件: Program.cs 项目: xmishon/cs2
        static void Main(string[] args)
        {
            Form form = new Form()
            {
                Width  = 800,
                Height = 600
            };

            Game.Init(form);
            form.Show();
            Game.Draw();
            Application.Run(form);
        }
示例#6
0
        static void Main(string[] args)
        {
            Form form = new Form();

            {
                form.Width  = 900 /*Screen.PrimaryScreen.Bounds.Width*/;
                form.Height = 600 /* Screen.PrimaryScreen.Bounds.Height*/;
            };
            Game.Init(form);
            form.Show();
            Game.Draw();
            Game.Level();
            Application.Run(form);
        }
示例#7
0
        static void Main(string[] args)
        {
            Thread.CurrentThread.Priority = ThreadPriority.Highest;

            Form form = new Form
            {
                Width  = Screen.PrimaryScreen.Bounds.Width,
                Height = Screen.PrimaryScreen.Bounds.Height
            };

            Game.Init(form);
            form.Show();
            Game.Draw();
            Application.Run(form);
        }
示例#8
0
        static void Main(string[] args)
        {
            Form form = new Form
            {
                Width      = Screen.PrimaryScreen.Bounds.Width,
                Height     = Screen.PrimaryScreen.Bounds.Height,
                ClientSize = new Size(1000, 1000),
            };

            Game.Init(form); // игра в этой форме
            form.Show();
            Game.Load();
            Game.Draw();
            Application.Run(form);
        }
示例#9
0
        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();
            //Timer timer = new Timer { Interval = 50 };
            Game.timer.Start();
            Game.timer.Tick += Timer_Tick;
            Application.Run(form);
        }
        static void Main(string[] args)
        {
            Form form = new Form
            {
                Width  = Screen.PrimaryScreen.Bounds.Width,
                Height = Screen.PrimaryScreen.Bounds.Height
            };

            //InitForm1(form);
            Game.Init(form);
            form.Show();
            Game.Draw();
            Application.Run(form);
            if (Program.streamWriter.BaseStream != null)
            {
                Program.streamWriter?.Close();
            }
        }
示例#11
0
        static void Main(string[] args)
        {
            Form form = new Form
            {
                Width           = 1000,
                Height          = 800,
                FormBorderStyle = FormBorderStyle.FixedDialog,
                MaximizeBox     = false,
                StartPosition   = FormStartPosition.CenterScreen
            };

            Game.Init(form);



            form.Show();
            Game.Draw();
            Application.Run(form);
        }
示例#12
0
        static void Main(string[] args)
        {
            Form form = new Form
            {
                Width  = Screen.PrimaryScreen.Bounds.Width,
                Height = Screen.PrimaryScreen.Bounds.Height
            };

            try
            {
                Game.Init(form);
            }
            catch (IndexOutOfRangeException)
            {
                Console.WriteLine($"Size of screen is invalid!");

                return;
            }
            form.Show();
            Game.Draw();
            Application.Run(form);
        }
示例#13
0
        static void Main(string[] args)
        {
            const int MAX_FORM_WIDTH = 1000, MAX_FORM_HEIGHT = 800;

            Form form = new Form();

            try
            {
                form.Width  = MAX_FORM_WIDTH;
                form.Height = MAX_FORM_HEIGHT;
                if (form.Width > MAX_FORM_WIDTH)
                {
                    throw new ArgumentOutOfRangeException("Превышена максимальная ширина экрана!");
                }
                if (form.Height > MAX_FORM_HEIGHT)
                {
                    throw new ArgumentOutOfRangeException("Превышена максимальная высота экрана!");
                }
            }
            catch (ArgumentOutOfRangeException ex)
            {
                MessageBox.Show($"{ex.Message} Попытаемся исправить...");
                if (form.Width > MAX_FORM_WIDTH)
                {
                    form.Width = MAX_FORM_WIDTH;
                }
                if (form.Height > MAX_FORM_HEIGHT)
                {
                    form.Height = MAX_FORM_HEIGHT;
                }
                MessageBox.Show($"Установлены максимально возможные размеры экрана.");
            }
            Game.Init(form);
            form.Show();
            Game.Draw();
            Application.Run(form);
        }
示例#14
0
        static void Main(string[] args)
        {
            Form menu = new Form();

            menu.Width  = 800;
            menu.Height = 600;
            SplashScreen.Init(menu);
            menu.Show();
            SplashScreen.Draw();

            Button startBtn = new Button
            {
                Text     = "Играть",
                Location = new System.Drawing.Point(menu.Width / 2 - 30, menu.Height / 3)
            };

            startBtn.Click += startBtnClick;
            menu.Controls.Add(startBtn);

            Button recordsBtn = new Button
            {
                Text     = "Рекорды",
                Location = new System.Drawing.Point(menu.Width / 2 - 30, menu.Height - menu.Height / 2)
            };

            recordsBtn.Click += recordsBtnClick;
            menu.Controls.Add(recordsBtn);

            Button exitBtn = new Button
            {
                Text     = "Выход",
                Location = new System.Drawing.Point(menu.Width / 2 - 30, menu.Height - menu.Height / 3)
            };

            exitBtn.Click += exitBtnClick;
            menu.Controls.Add(exitBtn);

            Label autor = new Label
            {
                Text      = "Ivan Syrovatskij " + DateTime.Now.Year.ToString(),
                ForeColor = System.Drawing.Color.White,
                BackColor = System.Drawing.Color.Black,
                AutoSize  = true,
                Font      = new Font("Arial", 8, FontStyle.Bold),
                Location  = new System.Drawing.Point(menu.Width / 10, menu.Height - menu.Height / 6)
            };

            menu.Controls.Add(autor);

            Application.Run(menu);


            void exitBtnClick(object sender, EventArgs e)
            {
                menu.Close();
            }

            void recordsBtnClick(object sender, EventArgs e)
            {
            }

            void startBtnClick(object sender, EventArgs e)
            {
                Form game = new Form();

                game.Width  = 800;
                game.Height = 600;
                Game.Init(game);
                game.FormClosed += Game_FormClosed;
                game.Show();
                Game.Draw();
            }
        }