Пример #1
0
 public Form1()
 {
     InitializeComponent();
     DoubleBuffered = true;
     topcinja       = new BallDoc();
     currentColor   = Color.Blue;
     pause          = true;
 }
Пример #2
0
        private void Form1_MouseClick(object sender, MouseEventArgs e)
        {
            if (e.Button != MouseButtons.Left)
            {
                return;
            }

            BallDoc.AddBall(e.Location, Color);
            Invalidate(true);
        }
Пример #3
0
        private void Form1_Paint(object sender, PaintEventArgs e)
        {
            e.Graphics.Clear(Color.White);

            BallDoc.Draw(e.Graphics);

            if (Filename != string.Empty)
            {
                this.Text = $"Ticking Pies | {Filename.Substring(Filename.LastIndexOf(@"\") + 1)}";
            }
            else
            {
                this.Text = "Ticking Pies";
            }
        }
Пример #4
0
        private void newToolStripMenuItem_Click(object sender, EventArgs e)
        {
            timer.Stop();

            if (MessageBox.Show("Are you sure you want to start a new game?", "Start a new game",
                                MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            {
                BallDoc       = new BallDoc();
                Color         = Color.CornflowerBlue;
                Filename      = string.Empty;
                btnStart.Text = "Старт";

                Invalidate(true);
            }
            else
            {
                if (btnStart.Text == "Стоп")
                {
                    timer.Start();
                }
            }
        }
Пример #5
0
 private void timer_Tick(object sender, EventArgs e)
 {
     BallDoc.Tick();
     Invalidate(true);
 }
Пример #6
0
 public Form1()
 {
     InitializeComponent();
     this.DoubleBuffered = true;
     BallDoc             = new BallDoc();
 }