Esempio n. 1
0
 public void AddColony(Point placeOfColony, Color color)
 {
     BoidColony newColony = new BoidColony(color, new Vector2(placeOfColony), this);
     _boidColonies.Add(newColony);
     Map.Children.Add(newColony);
     newColony.ProduceBoids(TimeSpan.FromMilliseconds(500), 100);
 }
Esempio n. 2
0
        public void AddColony()
        {
            //Place Colony Randomaly in some radius from another colony
            Vector2 position = GetRandomVector();
            foreach (BoidColony colony in this._boidColonies)
            {
                if (Vector2.Subtract(colony.Position, position).Length() < _colonyPositionRadius)
                {
                    position = GetRandomVector();
                }
            }

            //Vector2 position = new Vector2(x,y);

            BoidColony newColony = new BoidColony(SilverlightBoids.Logic.Styles.Colors.GetColor() , position, this);
            this.Map.Children.Add(newColony);
        }