Ejemplo n.º 1
0
    private void setUp()
    {
        //Sets up the players and enemies
        GameObject character1 = Instantiate(player1) as GameObject;
        GameObject character2 = Instantiate(player2) as GameObject;

        p1      = character1.GetComponent <Character> ();
        p2      = character2.GetComponent <Character> ();
        enemies = new Enemy[3];
        GameObject e1 = Instantiate(enemy) as GameObject;
        GameObject e2 = Instantiate(enemy) as GameObject;
        GameObject e3 = Instantiate(enemy) as GameObject;

        enemies [0]      = e1.GetComponent <Enemy>();
        enemies [1]      = e2.GetComponent <Enemy>();
        enemies [2]      = e3.GetComponent <Enemy>();
        enemies [0].Slot = 1;
        enemies [1].Slot = 2;
        enemies [2].Slot = 3;
        enemies [0].setSlot();
        enemies [1].setSlot();
        enemies [2].setSlot();
        //turnOrder = new GameObject[4];

        //Manages enemy selection
        selectedSlot = 0;
        GameObject theCursor = Instantiate(cursor) as GameObject;

        theCursor.GetComponent <Renderer>().enabled = false;
        selector = theCursor.GetComponent <AnimationOffset>();
        selector.setParent(enemies[selectedSlot].gameObject);

        menuOptions    = new string[4];
        menuOptions[0] = "Attack";
        menuOptions[1] = "Magic";
        menuOptions[2] = "Items";
        menuOptions[3] = "Flee";
        menuIndex      = 0;

        turn     = Turn.P1Choice;
        nextTurn = Turn.P1Choice;

        totalExpReward = 0;
    }
Ejemplo n.º 2
0
    private void setUp()
    {
        //Sets up the players and enemies
        GameObject character1 = Instantiate(player1) as GameObject;
        GameObject character2 = Instantiate(player2) as GameObject;

        p1 = character1.GetComponent <Character> ();
        p2 = character2.GetComponent <Character> ();
        GameObject boss1 = Instantiate(bossObject) as GameObject;

        boss      = boss1.GetComponent <Enemy>();
        boss.Slot = 1;
        boss.setSlot();
        boss.data().setMaxHealth(400);
        boss.data().setAttack(50);
        turnOrder = new GameObject[3];

        //Manages enemy selection
        selectedSlot = 0;
        GameObject theCursor = Instantiate(cursor) as GameObject;

        theCursor.GetComponent <Renderer>().enabled = false;
        selector = theCursor.GetComponent <AnimationOffset>();
        selector.setParent(boss.gameObject);

        menuOptions    = new string[4];
        menuOptions[0] = "Attack";
        menuOptions[1] = "Magic";
        menuOptions[2] = "Items";
        menuOptions[3] = "Flee";
        menuIndex      = 0;

        turn     = Turn.P1Choice;
        nextTurn = Turn.P1Choice;

        totalExpReward = 0;
    }