Пример #1
0
        /// <summary>
        /// Paint event of the form, see msdn for help => paint game with double buffering
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void GameForm_Paint(object sender, PaintEventArgs e)
        {
            BufferedGraphics bg = BufferedGraphicsManager.Current.Allocate(e.Graphics, e.ClipRectangle);
            Graphics         g  = bg.Graphics;

            g.Clear(Color.White);

            game.Draw(g);
            bg.Render();
            bg.Dispose();
        }
Пример #2
0
        static void Main(string[] args)
        {
            Game game = new Game();

            game.Init();
            while (Finder.Window.IsOpen)
            {
                game.Inputs();
                game.Update();
                game.Draw();
            }
        }
Пример #3
0
 private void FormInvaders_Paint(object sender, PaintEventArgs e)
 {
     _g = e.Graphics;
     _game.Draw(_g, _animationCell, _gameOver);
 }