예제 #1
0
        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);
        }
        //Инициализация формы игры
        public static void Init(Form gameform)
        {
            Game.Load(gameform);

            Timer timer = new Timer {
                Interval = 42
            };

            timer.Start();
            timer.Tick += Timer_Tick;

            Graphics g;

            _context = BufferedGraphicsManager.Current;
            g        = gameform.CreateGraphics();

            Width  = gameform.ClientSize.Width;
            Height = gameform.ClientSize.Height;
            Buffer = _context.Allocate(g, new Rectangle(0, 0, Width, Height));
        }
        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);
        }