Exemplo n.º 1
0
 // Start is called before the first frame update
 void Start()
 {
     player1 = j.GetComponent <Javachu>();
     player2 = p.GetComponent <Nohtyp>();
     Debug.Log("test?" + player1.getHealth());
     move1  = false;
     move2  = false;
     player = true;
     //move1 is if player 1 input a move and move2 is if player 2 input a move
 }
Exemplo n.º 2
0
    // Start is called before the first frame update
    void Start()
    {
        t = new TurnManager();
        p = new Nohtyp();
        j = new Javachu();
        bool b = t.getTurn();

        move1      = false;
        move2      = false;
        moveCount2 = -1;
        moveCount1 = -1;
        //move1 is if player 1 input a move and move2 is if player 2 input a move
    }
Exemplo n.º 3
0
    // Start is called before the first frame update
    void Start()
    {
        t = GameObject.Find("TurnManager").GetComponent <TurnManager>();
        p = GameObject.Find("HealthBar2").GetComponent <Nohtyp>();
        j = GameObject.Find("HealthBar1").GetComponent <Javachu>();
        bool b = t.getTurn();

        move1      = false;
        move2      = false;
        moveCount2 = -1;
        moveCount1 = -1;
        //move1 is if player 1 input a move and move2 is if player 2 input a move
    }
Exemplo n.º 4
0
    // Start is called before the first frame update
    void Start()
    {
        Javachu j = GameObject.Find("HealthBar1").GetComponent <Javachu>();
        Nohtyp  p = GameObject.Find("HealthBar2").GetComponent <Nohtyp>();

        for (int i = 0; i < 4; i++)
        {
            GameObject clone = Instantiate(card, new Vector3(i * 3.6F - 4.02F, -3.48F, 0), Quaternion.identity);
            Move       move  = clone.GetComponent <Move>();
            move.player1    = true;
            move.identifier = i;
            //set image for move here
        }
        for (int i = 0; i < 4; i++)
        {
            GameObject clone = Instantiate(card, new Vector3(4.02F - i * 3.6F, 3.48F, 0), Quaternion.identity);
            Move       move  = clone.GetComponent <Move>();
            move.player1    = false;
            move.identifier = i;
            //set image for move here
        }
    }
Exemplo n.º 5
0
 // Start is called before the first frame update
 void Start()
 {
     player1 = j.GetComponent <Javachu>();
     player2 = p.GetComponent <Nohtyp>();
 }
Exemplo n.º 6
0
    // Start is called before the first frame update
    void Start()
    {
        Javachu j = GameObject.Find("HealthBar1").GetComponent <Javachu>();
        Nohtyp  p = GameObject.Find("HealthBar2").GetComponent <Nohtyp>();

        for (int i = 0; i < 4; i++)
        {
            GameObject clone = Instantiate(card, new Vector3(i * 3.6F - 4.02F, -3.48F, 0), Quaternion.identity);
            Move       move  = clone.GetComponent <Move>();
            move.player1    = true;
            move.identifier = i;
            spriteR         = move.transform.GetChild(0).gameObject.GetComponent <SpriteRenderer>();
            if (i == 0)
            {
                spriteR.sprite = Resources.Load <Sprite>("Sprites/wmove");
                GameObject canvas = clone.transform.GetChild(1).gameObject;
                canvas.transform.GetChild(0).gameObject.GetComponent <Text>().text = "System.out.\nprintln(\"shock\")";
                canvas.transform.GetChild(1).gameObject.GetComponent <Text>().text = "Base Attack, Does three damage";
            }
            else if (i == 1)
            {
                GameObject canvas = clone.transform.GetChild(1).gameObject;
                spriteR.sprite = Resources.Load <Sprite>("Sprites/amove");
                canvas.transform.GetChild(0).gameObject.GetComponent <Text>().text = "Java destruction 9000";
                canvas.transform.GetChild(1).gameObject.GetComponent <Text>().text = "Deals large damage at a cost";
            }
            else if (i == 2)
            {
                GameObject canvas = clone.transform.GetChild(1).gameObject;
                spriteR.sprite = Resources.Load <Sprite>("Sprites/smove");
                canvas.transform.GetChild(0).gameObject.GetComponent <Text>().text = "(int) (Math.Random()*5)";
                canvas.transform.GetChild(1).gameObject.GetComponent <Text>().text = "Does Anywhere between one and five damage";
            }
            else if (i == 3)
            {
                GameObject canvas = clone.transform.GetChild(1).gameObject;
                spriteR.sprite = Resources.Load <Sprite>("Sprites/dmove");
                canvas.transform.GetChild(0).gameObject.GetComponent <Text>().text = "hp+=2";
                canvas.transform.GetChild(1).gameObject.GetComponent <Text>().text = "Heal for two health";
            }
        }
        for (int i = 0; i < 4; i++)
        {
            GameObject clone = Instantiate(card, new Vector3(3.36F - i * 3.6F, 3F, 0), Quaternion.identity);
            Move       move  = clone.GetComponent <Move>();
            move.player1    = false;
            move.identifier = i;
            spriteR         = move.transform.GetChild(0).gameObject.GetComponent <SpriteRenderer>();
            if (i == 0)
            {
                GameObject canvas = clone.transform.GetChild(1).gameObject;
                spriteR.sprite = Resources.Load <Sprite>("Sprites/upmove");
                canvas.transform.GetChild(0).gameObject.GetComponent <Text>().text = "git commit";
                canvas.transform.GetChild(1).gameObject.GetComponent <Text>().text = "Base Attack, does three damage";
            }
            else if (i == 1)
            {
                GameObject canvas = clone.transform.GetChild(1).gameObject;
                spriteR.sprite = Resources.Load <Sprite>("Sprites/leftmove");
                canvas.transform.GetChild(0).gameObject.GetComponent <Text>().text = "Delete the repository";
                canvas.transform.GetChild(1).gameObject.GetComponent <Text>().text = "Deals large damage at a cost";
            }
            else if (i == 2)
            {
                GameObject canvas = clone.transform.GetChild(1).gameObject;
                spriteR.sprite = Resources.Load <Sprite>("Sprites/downmove");
                canvas.transform.GetChild(0).gameObject.GetComponent <Text>().text = "git pull request";
                canvas.transform.GetChild(1).gameObject.GetComponent <Text>().text = "Does Anywhere between one and five damage";
            }
            else if (i == 3)
            {
                GameObject canvas = clone.transform.GetChild(1).gameObject;
                spriteR.sprite = Resources.Load <Sprite>("Sprites/rightmove");
                canvas.transform.GetChild(0).gameObject.GetComponent <Text>().text = "git reset";
                canvas.transform.GetChild(1).gameObject.GetComponent <Text>().text = "Heals two health";
            }
        }
        card.GetComponent <SpriteRenderer>().enabled = false;
    }