示例#1
0
        private void button1_Click(object sender, EventArgs e)
        {
            Graphics g = this.panel1.CreateGraphics();

            thucan      = new ThucAn();
            thucan.TyLe = 50;
            thucan.X    = (int)(this.panel1.Width / thucan.TyLe);
            thucan.Y    = (int)(this.panel1.Height / thucan.TyLe);

            thucan.g = g;
            thucan.VeThucAn(false);
            g.Dispose();
        }
示例#2
0
        private void TaoThucAn()
        {
            thucan      = new ThucAn();
            thucan.TyLe = snack.TyLe;
            Random rnd = new Random();
            int    x   = rnd.Next((int)(this.panel1.Width / thucan.TyLe));
            int    y   = rnd.Next((int)(this.panel1.Height / thucan.TyLe));

            thucan.X = x;
            thucan.Y = y;
            thucan.g = g;
            thucan.VeThucAn(false);
        }
示例#3
0
 private void LamSach()
 {
     snack  = null;
     thucan = null;
     g.Clear(Color.FromName(this.panel1.BackColor.Name.ToString()));
 }