Example #1
0
    // Update is called once per frame
    void Update()
    {
        switch (battleState)
        {
        case (PerformAction.wait):
            if (PerformList.Count > 0)
            {
                battleState = PerformAction.takeAction;
            }
            break;

        case (PerformAction.takeAction):
            GameObject performer = GameObject.Find(PerformList[0].Attacker);
            if (PerformList[0].Type == "Player2")
            {
                Player2Script plyr2 = performer.GetComponent <Player2Script>();
                plyr2.targetEnemy  = PerformList[0].AttackersTarget;
                plyr2.currentState = Player2Script.Turnstate.action;
            }
            if (PerformList[0].Type == "Player")
            {
                Player1Script plyr = performer.GetComponent <Player1Script>();
                plyr.targetEnemy  = PerformList[0].AttackersTarget;
                plyr.currentState = Player1Script.Turnstate.action;
            }
            break;

        case (PerformAction.performAction):

            break;
        }

        battleState = PerformAction.performAction;
    }
Example #2
0
 // Use this for initialization
 void Start()
 {
     player1       = GameObject.FindWithTag("Player");
     player2       = GameObject.FindWithTag("Player2");
     player1Script = player1.GetComponent <Player1Script>();
     player2Script = player2.GetComponent <Player2Script>();
     Glower        = this.gameObject.GetComponent <ParticleSystem>();
     Glower.Stop();
 }
    void Awake()
    {
        // Setting up the references.
        anim = GetComponent<Animator>();
        player1Movement = GetComponent<Player1Script>();
        //playerShooting = GetComponentInChildren<PlayerShooting>();

        // Set the initial health of the player.
        currentHealth = startingHealth;
    }
Example #4
0
 // Use this for initialization
 void Start()
 {
     player1 = GameObject.FindGameObjectWithTag("Player").GetComponent <Player1Script>();
     StatesUp.gameObject.SetActive(false);
     StartPosition = new Vector3(this.gameObject.transform.position.x, this.gameObject.transform.position.y, this.gameObject.transform.position.z);
     animPlayer1   = GameObject.FindGameObjectWithTag("Player2").gameObject.GetComponent <Animator>();
     targetEnemy   = GameObject.FindGameObjectWithTag("Player");
     bsm           = GameObject.FindGameObjectWithTag("BSM").GetComponent <BattleStateMachine>();
     currentState  = Turnstate.waiting;
 }
Example #5
0
    // Use this for initialization
    void Start()
    {
        battleState = PerformAction.wait;
        Player1     = GameObject.FindGameObjectWithTag("Player").GetComponent <Player1Script>();
        Player2     = GameObject.FindGameObjectWithTag("Player2").GetComponent <Player2Script>();


        P1.Add(GameObject.FindGameObjectWithTag("Player"));
        P2.Add(GameObject.FindGameObjectWithTag("Player2"));
    }
Example #6
0
    // Use this for initialization
    void Start()
    {
        player1 = GameObject.FindGameObjectWithTag("Player").GetComponent <Player1Script>();
        player2 = GameObject.FindGameObjectWithTag("Player2").GetComponent <Player2Script>();
        int startingWord = Random.Range(4, words.Length);

        currentWord = startingWord;
        int indexChar = Random.Range(0, words.Length - 1);

        //txtChoices.text = words[indexChar].ToString ();
        showScrambleLetters(currentWord);
    }
    private void OnTriggerEnter2D(Collider2D hitInfo)
    {
        Debug.Log(hitInfo.name);
        Player1Script p1 = hitInfo.GetComponent <Player1Script>();

        if (p1 != null)
        {
            p1.TakesDamage1(damage2);
            Destroy(gameObject);
        }
        else if (hitInfo.name == "Background")
        {
            Destroy(gameObject);
        }
    }
Example #8
0
 // Use this for initialization
 void Start()
 {
     player1 = GameObject.FindGameObjectWithTag("Player").GetComponent <Player1Script>();
     player2 = GameObject.FindGameObjectWithTag("Player").GetComponent <Player2Script>();
 }
Example #9
0
 // Start is called before the first frame update
 void Start()
 {
     player1 = GetComponent <Player1Script>();
 }
 private void Awake()
 {
     current = this;
 }