示例#1
0
        public Form1()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            for (int i = 0; i < kNumberOfRows; i++)
            {
                Rows[i] = new Row(i);
            }

            ThePaddle.Position.X = 5;
            ThePaddle.Position.Y = this.ClientRectangle.Bottom - ThePaddle.Height;

            TheBall.Position.Y = this.ClientRectangle.Bottom - 200;

            this.SetBounds(this.Left, this.Top, Rows[0].GetBounds().Width, this.Height);

            TheScore = new Score(ClientRectangle.Right - 50, ClientRectangle.Bottom - 180);

            // choose Level
            SpeedDialog dlg = new SpeedDialog();

            if (dlg.ShowDialog() == DialogResult.OK)
            {
                timer1.Interval = dlg.Speed;
            }
            //
            // TODO: Add any constructor code after InitializeComponent call
            //
        }
示例#2
0
        public Form1()
        {
            InitializeComponent();

            for (int i = 0; i < kNumberOfRows; i++)
            {
                Rows[i] = new Row(i);
            }

            ThePaddle.Position.X = 5;
            ThePaddle.Position.Y = this.ClientRectangle.Bottom - ThePaddle.Height;

            TheBall.Position.Y = this.ClientRectangle.Bottom - 200;

            this.SetBounds(this.Left, this.Top, Rows[0].GetBounds().Width, this.Height);

            TheScore = new Score(ClientRectangle.Right - 50, ClientRectangle.Bottom - 180);

            //chose Level
            SpeedDialog dlg = new SpeedDialog();

            if (dlg.ShowDialog() == DialogResult.OK)
            {
                timer1.Interval = dlg.Speed;
            }
        }