Ejemplo n.º 1
1
    // Use this for initialization
    void Start()
    {
        LookForFirst();
        ai = GetComponent<Ai>();

        waypoint = GameObject.Find("Waypoint 2");
    }
Ejemplo n.º 2
1
        public void Setup()
        {
            _game = new FiveByFiveGame();
            _player = new Player {IsHumanPlayer = false, Strikes = 0};

            _game.AddPlayer(_player);

            _ai = new EasyAi();
        }
Ejemplo n.º 3
1
        public void GetAiChoiceReturnsSomethingOtherThanUndetermined()
        {
            //initialize
            Ai target = new Ai();
            RpsEnum unexpected = RpsEnum.Undetermined;
            RpsEnum actual;

            //setup
            actual = target.GetAiChoice(null);

            //assert
            Assert.AreNotEqual(unexpected, actual);
        }
    public void fire()
    {
        update = true;
        clicksExist = wb.existingClicks;

        GameObject aiPrefab = (GameObject)Resources.Load("Prefabs/AiManagement");
        goSpecial = Instantiate(aiPrefab);

        Vector2 newPosition;

        try{
            newPosition = new Vector2(
                gameObject.transform.parent.GetComponentInChildren<Player>().posX + 1,
                gameObject.transform.parent.GetComponentInChildren<Player>().posY);
        }
        catch (Exception e)
        {
            newPosition = new Vector2(
                gameObject.transform.parent.GetComponentInChildren<Ai>().posX + 1,
                gameObject.transform.parent.GetComponentInChildren<Ai>().posY);

        }

        goSpecial.transform.position = newPosition;

        goSpecial.name = "Tesla CLONE [" + playerBase.playerNumber + "]";
        special = goSpecial.transform.GetChild(0).GetComponent<Ai>();
        special.isClone = true;
        PlayerInfo specialInfo = new PlayerInfo();

        specialInfo.playerNumber = playerBase.playInfo.playerNumber;
        specialInfo.charEnum = playerBase.playInfo.charEnum;
        specialInfo.playerColor = playerBase.playInfo.playerColor;
        specialInfo.lifes = playerBase.playInfo.lifes;

        special.SetUpPlayer(specialInfo);
        special.hitPoints = 70;

        //special.weaponHandling.inventory.Remove(special.weaponHandling.weapons[WeaponEnum.specialTesla]);

        //suposing pistol is on position 0 in inventory
        special.weaponHandling.RemoveFromInventoryAllBut(WeaponEnum.pistol);
        special.weaponHandling.activeWeapon = special.weaponHandling.inventory[0];

        /*
        for (int i = special.weaponHandling.inventory.Count-1; i > 0;i--)
        {
            special.weaponHandling.inventory.RemoveAt(i);
        }*/
    }
Ejemplo n.º 5
1
 public void ChangeTask(Ai.Task t)
 {
     Time = 0;
     CurrentTask = t;
     Cheetah.Console.WriteLine("bot task: " + t.GetType().Name);
 }
Ejemplo n.º 6
1
    public void LoadPlayersTypes()
    {
        prefab = (GameObject)Resources.Load("Prefabs/PlayerManagment");
        aiPrefab = (GameObject)Resources.Load("Prefabs/AiManagement");

        switch (gameInfo.player1type)
        {
            case PlayerTypeEnum.Player:
                player1 = Instantiate(prefab);
                player1Comp = player1.transform.GetChild(0).GetComponent<Player>();
                player1.SetActive(false);
                break;
            case PlayerTypeEnum.AI:
                player1 = Instantiate(aiPrefab);
                ai1Comp = player1.transform.GetChild(0).GetComponent<Ai>();
                player1.SetActive(false);
                break;
        }
        switch (gameInfo.player2type)
        {
            case PlayerTypeEnum.Player:
                player2 = Instantiate(prefab);
                player2Comp = player2.transform.GetChild(0).GetComponent<Player>();
                player2.SetActive(false);
                break;
            case PlayerTypeEnum.AI:
                player2 = Instantiate(aiPrefab);
                ai2Comp = player2.transform.GetChild(0).GetComponent<Ai>();
                player2.SetActive(false);
                break;
        }
        switch (gameInfo.player3type)
        {
            case PlayerTypeEnum.Player:
                player3 = Instantiate(prefab);
                player3Comp = player3.transform.GetChild(0).GetComponent<Player>();
                player3.SetActive(false);
                break;
            case PlayerTypeEnum.AI:
                player3 = Instantiate(aiPrefab);
                ai3Comp = player3.transform.GetChild(0).GetComponent<Ai>();
                player3.SetActive(false);
                break;
        }
        switch (gameInfo.player4type)
        {
            case PlayerTypeEnum.Player:
                player4 = Instantiate(prefab);
                player4Comp = player4.transform.GetChild(0).GetComponent<Player>();
                player4.SetActive(false);

                break;
            case PlayerTypeEnum.AI:
                player4 = Instantiate(aiPrefab);
                ai4Comp = player4.transform.GetChild(0).GetComponent<Ai>();
                player4.SetActive(false);

                break;
        }
    }
Ejemplo n.º 7
1
 public GameForm()
 {
     InitializeComponent();
     board = new Board();
     ai = new Ai();
 }