예제 #1
0
        /// <summary>
        /// warning: motor should be created before creating an agent. if not, use AttachBike to assign motor correctly
        /// </summary>
        public BotAgent(AgentController ac, string name, int motorID)
            : base(ac, name)
        {
            this.motorID = motorID;
            ownMotor = (BotMotor)GameSettings.gameMotors[motorID];
            teammates = new Hashtable();
            enemies = new Hashtable();
            friendlyAgents = new Hashtable();
            steeringLocked = false;

            target = -1;
            lastTargetHP = 0;
            faData = new FoolAroundData();
            avaisionPenalty = 0;
        }
예제 #2
0
        void menu_InitBackground()
        {
            if (menu_background)
                menu_DestroyBackground();

            motorek = new PlayerMotor(this, 0, new Color(255, 255, 255));
            motorek.name = "";
            menu_bots = new BotMotor[3];
            menu_bots[0] = new BotMotor(this, Color.Red);
            menu_bots[0].name = "";
            menu_bots[1] = new BotMotor(this, Color.Green);
            menu_bots[1].name = "";
            menu_bots[2] = new BotMotor(this, Color.Blue);
            menu_bots[2].name = "";
            motorek.LoadAndInitialize(new Rectangle(0, 0, 800, 600));
            motorek.Spawn(new Vector2(400, 300), 90);
            menu_bots[0].LoadAndInitialize(new Rectangle(0, 0, 900, 700));
            menu_bots[0].Spawn(new Vector2(10, 10), 135);
            menu_bots[1].LoadAndInitialize(new Rectangle(0, 0, 900, 700));
            menu_bots[1].Spawn(new Vector2(10, 600 - 10), 45);
            menu_bots[2].LoadAndInitialize(new Rectangle(0, 0, 900, 700));
            menu_bots[2].Spawn(new Vector2(800 - 10, 600 - 10), -45);
            menu_background = true;
        }
예제 #3
0
 public void AttachBike(int motorID)
 {
     this.motorID = motorID;
     ownMotor = (BotMotor)GameSettings.gameMotors[motorID];
     teammates = new Hashtable();
     enemies = new Hashtable();
     friendlyAgents = new Hashtable();
 }