示例#1
0
 private void creerFlocons(int nombre)
 {
     int tempGen;
     m_arrayFlocons = new Flocon[nombre];
     for (int i = 0; i < m_arrayFlocons.Length; i++)
     {
         tempGen = rng.Next(-100, this.Size.Width);
         if (rng.Next(0, 50) > 10)
         {
             m_arrayFlocons[i] = new Flocon(new int[] { tempGen, rng.Next(0, this.Size.Height) }, new int[] { rng.Next(tempGen, tempGen + 275), this.Size.Height },
                                             this.Size.Height - m_nbPixelCollision);
         }
         else
         {
             m_arrayFlocons[i] = new Flocon(new int[] { tempGen, rng.Next(0, this.Size.Height) }, new int[] { rng.Next(tempGen - 100, tempGen), this.Size.Height },
                         this.Size.Height - m_nbPixelCollision);
         }
     }
 }
示例#2
0
 private void ajouterFloconSol(Flocon f)
 {
     lock (lockIMG)
     {
         using (Graphics g = Graphics.FromImage(solIMG))
         {
             g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
             g.FillEllipse(Brushes.White, f.coordinates[0], f.coordinates[1], f.taille, f.taille);
         }
     }
 }