Beispiel #1
0
 public void CreateFlock(List <Texture2D> PetalTextures, Texture2D RogueTexture)
 {
     for (int i = 0; i < NumFlock; i++)
     {
         Agents.Add(new FlockAgent(FlockTools.Pick(PetalTextures)));
     }
     for (int i = 0; i < NumRogue; i++)
     {
         Agents.Add(new RogueAgent(RogueTexture));
     }
 }
Beispiel #2
0
 private void CreateHistory()
 {
     for (int i = Past.Count - 1; i >= 0; i--)
     {
         Past[i].Color.A -= 5;
         if (Past[i].Color.A < 5)
         {
             Past.RemoveAt(i);
         }
     }
     if (Past.Count > 0)
     {
         int   index       = FlockTools.GetRandomInteger(Past.Count);
         Color PickedColor = FlockTools.Pick(new List <Color> {
             Color.DarkSeaGreen, Color.DarkTurquoise, Color.DarkRed, Color.LightYellow, Color.White, Color.FloralWhite
         }) * 0.5f;
         PickedColor.A     = Past[index].Color.A;
         Past[index].Color = PickedColor;
     }
     Past.Add(new PastPosition()
     {
         Position = Position + FlockTools.GetRandomVector2(-2, 2, -2, 2), Color = Color.White
     });
 }