Пример #1
0
        unsafe private void timer1_Tick(object sender, EventArgs e)
        {
            tempbitmap = nowimage;
            time++;
            // time2++;
            timer1.Enabled = false;
            gs.test01(tempbitmap, time, tra1, tra2, tra3, tra4, tra5, tra6);
            pictureBox1.Image = tempbitmap;
            time = 0;

            /* if (time2 < 10)
             *   gs.test01(tempbitmap, time, tra1, tra2, tra3, tra4, tra5, tra6);
             * else
             * {
             *   gs.test02( time, tra1, tra2, tra3, tra4, tra5, tra6);
             *   pictureBox1.Image = tempbitmap;
             *   time2 = 0;
             * }*/
            timer1.Enabled = true;
        }
Пример #2
0
        unsafe private void timer1_Tick(object sender, EventArgs e)
        {
            tempbitmap = nowimage;
            time++;

            timer1.Enabled = false;
            // gs.test01(tempbitmap, time, tra1, tra2, tra3, tra4, tra5, tra6);
            // pictureBox1.Image = tempbitmap;

            if (time2 <= 1)
            {
                gs.test02(time, tra1, tra2, tra3, tra4, tra5, tra6);
            }
            else
            {
                gs.test01(tempbitmap, time, tra1, tra2, tra3, tra4, tra5, tra6);
                pictureBox1.Image = tempbitmap;
                time2             = 0;
            }
            time = 0;
            time2++;
            timer1.Enabled = true;
        }
Пример #3
0
        unsafe private void timer1_Tick(object sender, EventArgs e)
        {
            tempbitmap     = nowimage;
            time          += 1;
            timer1.Enabled = false;
            time           = gs.test01(tempbitmap, time, tra1, tra2, tra3, tra4, tra5, tra6);
            //if (time % 2 == 0)
            pictureBox1.Image = tempbitmap;
            timer1.Enabled    = true;
            return;

            /* time += 1;
             * timer1.Enabled = false;
             *
             *
             * Graphics g = Graphics.FromImage(tempbitmap);
             * g.Clear(Color.Black);
             *
             * coordinate += tra1;
             * if (time >= tra6)
             * {
             *   enemynumber += 1;
             *   tempxy += 1;
             *
             *   time = 0;
             *
             *   if (enemynumber >= 990)
             *       enemynumber = 990;
             *   if (coordinate >= 360)
             *   { //coordinate -= 360;
             *   }
             *   if (tempxy >= 990)
             *       tempxy = 0;
             *   enemyX0[tempxy] = tra4;
             *   enemyY0[tempxy] = tra5;
             *   enemybool[tempxy] = true;
             *   enemydistance[tempxy] = 0;
             *   enemycoordinate[tempxy] = 0;
             *   enemycoordinate[tempxy] += coordinate;
             * }
             *
             * Pen myPen = new Pen(Color.FromArgb(255, 100, 0, 0), tra3);
             * Pen myPen2 = new Pen(Color.FromArgb(255, 0, 100, 0), tra3);
             * Pen mePen = new Pen(Color.FromArgb(255, 100, 100, 100), 50);
             * g.DrawEllipse(mePen, meX - 25, meY - 25, 50, 50);
             * for (int i = 0; i <= 990; i++)
             * {
             *   enemydistance[i] += tra2;
             *
             *
             *
             *   double x = 0, y = enemydistance[i];
             *   double x2 = (x * Math.Cos(enemycoordinate[i]) - y * Math.Sin(enemycoordinate[i]));
             *   double y2 = (x * Math.Sin(enemycoordinate[i]) + y * Math.Cos(enemycoordinate[i]));
             *   x2 = enemyX0[i] - x2; y2 = enemyY0[i] - y2;
             *   if (x2 > 0 && x2 < bitmapwidth && y2 > 0 && y2 < bitmapheight)
             *   {
             *
             *
             *       if ((i % 2) == 0)
             *       { g.DrawEllipse(myPen, (float)x2, (float)y2, tra3, tra3); }
             *       else
             *       { g.DrawEllipse(myPen2, (float)x2, (float)y2, tra3, tra3); }
             *
             *   }
             *
             *
             *   if (tempxy >= 990)
             *   {
             *       for (int i2 = 0; i2 <= 989; i2++)
             *       {
             *           enemydistance[i2] = enemydistance[i2 + 1];
             *           enemycoordinate[i2] = enemycoordinate[i2 + 1];
             *           enemyX0[i2] = enemyX0[i2 + 1];
             *           enemyY0[i2] = enemyY0[i2 + 1];
             *           enemydistance[990] = 0;
             *           enemycoordinate[990] = 0;
             *           enemyX0[990] = tra4;
             *           enemyY0[990] = tra5;
             *       }
             *
             *       break;
             *   }
             * }
             *
             * g.Dispose();
             * pictureBox1.Image = tempbitmap;
             * timer1.Enabled = true;
             */
        }