コード例 #1
0
 public Form1()
 {
     InitializeComponent();
     this.FormBorderStyle = FormBorderStyle.None;
     this.WindowState     = FormWindowState.Maximized;
     new Thread(() =>
     {
         try
         {
             Tang.loadFile(GlobalVariable.CURRENT_PATH + "/tang.txt");
         }
         catch { }
     }).Start();
     this.TopMost         = true;
     width                = System.Windows.Forms.Screen.GetBounds(this).Width;
     height               = System.Windows.Forms.Screen.GetBounds(this).Height;
     r                    = new Random();
     this.BackColor       = Color.Black;
     this.TransparencyKey = Color.Black;
     timer1.Interval      = 50;
     while (true)
     {
         if (GlobalVariable.tangList.Count > 0)
         {
             tr = new Tang(mls[r.Next(0, mls.Count)], cs[r.Next(0, cs.Count)],
                           GlobalVariable.tangList[r.Next(0, GlobalVariable.tangList.Count)]);
             timer1.Start();
             break;
         }
     }
 }
コード例 #2
0
 private void timer1_Tick(object sender, EventArgs e)
 {
     if (tr.lm.getStatus() == Status.FINISH)
     {
         IMoveRule v = mls[r.Next(0, mls.Count)];
         v.init();
         IColorRule c = cs[r.Next(0, cs.Count)];
         c.init();
         tr = new Tang(v, c, GlobalVariable.tangList[r.Next(0, GlobalVariable.tangList.Count)]);
     }
     this.Invalidate();
 }