Пример #1
0
 public FpsCounter(Main game, Vector2 position)
     : base(game)
 {
     this.game = game;
     this.position = position;
     game.Components.Add(this);
 }
Пример #2
0
 public Pheromone(Main game, bool active)
     : base(game, active)
 {
     // make sure it loads and draws
     DrawOrder = 49;
     UpdateOrder = 50;
 }
Пример #3
0
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 static void Main(string[] args)
 {
     using (Main game = new Main())
     {
         game.Run();
     }
 }
Пример #4
0
        public MouseEventsManager(Main game)
            : base(game)
        {
            this.game = game;
            game.Components.Add(this);

            this.DrawOrder = 100;
        }
Пример #5
0
 public Ant(Main game, bool active)
     : base(game, active)
 {
     hungry = 0;
     life = ConstantsHolder.Singleton.LifeMax;
     pheromonesTick = 0;
     Origin = new Vector2(8, 7);
     choicePheromones = new Aints.Behaviours.AntBehaviourFollowPheromone(game, this, false);
     // make sure it loads and draws
     DrawOrder = 50;
     UpdateOrder = 50;
 }
Пример #6
0
        public AntHill(Main game, Vector2 position)
            : base(game,true)
        {
            this.scale = 2f;

            food = 2000;
            prevFood = food;
            this.game = game;
            this.Position = position;

            this.logFile = @".\log" + DateTime.Now.Ticks + ".txt";
            tw = new StreamWriter(this.logFile);
        }
Пример #7
0
        public GameObject(Main game, bool active)
            : base(game)
        {
            this.game = game;
            if (active)
            {
                game.Components.Add(this);
            }
            SetupBehaviours();
            maxSpeed = 100f;

            this.Enabled = active;
            this.Visible = active;
        }
Пример #8
0
        public Pools(Main game)
        {
            this.game = game;
            this.PoolPheromones = new List<Pheromone>(POOL_SIZE_PHEROMONES);
            this.PoolAnts = new List<Ant>(POOL_SIZE_ANTS);

            for (int i = 0; i < POOL_SIZE_PHEROMONES; i++)
            {
                PoolPheromones.Add(new Pheromone(game, false));
            }
            for (int i = 0; i < POOL_SIZE_ANTS; i++)
            {
                PoolAnts.Add(new Ant(game, false));
            }
        }