示例#1
0
        public Creature(CreatureGroup group, float x, float y, Chromosome chromo = null)
            : base(x, y)
        {
            this.group = group;

            if (chromo != null)
            {
                chromosome = chromo;
            }
            else
            {
                chromosome = new Chromosome();
            }
            SetProperties();
        }
示例#2
0
        public GameWorld(Game1 gameRef)
        {
            this.gameRef = gameRef;
            entityManager = new EntityManager(this);

            resourceManager = new ResourceManager(this);
            HerbivoreGroup = new CreatureGroup(CreatureType.Herbivore, this);
            CarnivoreGroup = new CreatureGroup(CreatureType.Carnivore, this);
            OmnivoreGroup = new CreatureGroup(CreatureType.Omnivore, this);

            // Create entities
            resourceManager.CreateResourceCluster(15, 150, new Vector2(150, 150));
            resourceManager.CreateResourceCluster(15, 150, new Vector2(Game1.ScreenBounds.Width - 150, 150));
            resourceManager.CreateResourceCluster(15, 150, new Vector2(150, Game1.ScreenBounds.Height - 150));
            resourceManager.CreateResourceCluster(15, 150, new Vector2(Game1.ScreenBounds.Width - 150, Game1.ScreenBounds.Height - 150));
            resourceManager.CreateResourceCluster(15, 150, new Vector2((Game1.ScreenBounds.Width - 150) / 2, (Game1.ScreenBounds.Height - 150) / 2));

            HerbivoreGroup.CreatePopulation(50);
            CarnivoreGroup.CreatePopulation(50);
            OmnivoreGroup.CreatePopulation(50);

            entityManager.LoadContent(gameRef.Content);
        }
示例#3
0
 public Omnivore(CreatureGroup group, float x, float y, Chromosome chromo = null)
     : base(group, x, y)
 {
 }