Example #1
0
 private void OyunForm_Load(object sender, EventArgs e)
 {
     oyun              = new Oyun();
     Oyun.OnCiz       += Oyun_OnCiz;
     Oyun.OnOyunBitti += Oyun_OnOyunBitti;
     Application.AddMessageFilter(this);
 }
Example #2
0
 private void PicBaslat_Click(object sender, EventArgs e)
 {
     if (!IlkBaslama)
     {
         IlkBaslama             = true;
         PicBaslat.Image        = Properties.Resources.StartBtn_Off;
         PicYenidenBaslat.Image = Properties.Resources.ResBtn_On;
         oyun      = new Oyun();
         oynThread = new Thread(() => oyun.Baslat())
         {
             IsBackground = true
         };
         oynThread.Start();
     }
 }
Example #3
0
 private void PicYenidenBaslat_Click(object sender, EventArgs e)
 {
     if (IlkBaslama)
     {
         oyun.OyunBittiMi = true;
         if (oynThread.ThreadState == ThreadState.Running)
         {
             oynThread.Abort();
         }
         oyun      = new Oyun();
         oynThread = new Thread(() => oyun.Baslat())
         {
             IsBackground = true
         };
         oynThread.Start();
     }
 }