public void NoneChose()
 {
     XO   = PlyerSide.None;
     PCXO = PCSide.None;
     spriteRenderer.sprite = null;
     stat = StatusOfGame.ChuseSide;
 }
Пример #2
0
 public void SelectItem()
 {
     if (haveItems[SelectedInventoryItem - 1] == true)
     {
         shipImage = SelectedInventoryItem;
         StatusOfGame.SelectShipType(SelectedInventoryItem);
     }
 }
 public void XChose()
 {
     if (XO == PlyerSide.None)
     {
         XO   = PlyerSide.X;
         PCXO = PCSide.O;
         stat = StatusOfGame.Play;
     }
 }
Пример #4
0
    public void BuyShip()
    {
        int coins = StatusOfGame.GetCoins();

        Debug.Log(selectedItem);

        if (coins >= Price[selectedItem] & Items[selectedItem] == false)
        {
            StatusOfGame.MinusCoins(Price[selectedItem]);
            Items[selectedItem] = true;
            InventoryScript.BoughtItem(selectedItem);
            Price[selectedItem] = -1;
            PriceUpdater.ChangeItemSelected(Price[selectedItem]);
            Debug.Log("Bought Item: " + selectedItem);
        }
    }
    public void PCMove()
    {
        if (stat == StatusOfGame.Wait && GameObject.FindGameObjectsWithTag("Empty").Length > 0)
        {
            if (PCXO == PCSide.X)
            {
                var Temp = GameObject.FindGameObjectsWithTag("Empty") [(Random.Range(0, GameObject.FindGameObjectsWithTag("Empty").Length))].GetComponent <SpriteRenderer> ();
                Temp.sprite = X;
                Temp.tag    = "X";
                Temp.GetComponent <Collider2D> ().enabled = false;
                stat = StatusOfGame.Wait;
            }

            if (PCXO == PCSide.O)
            {
                var Temp = GameObject.FindGameObjectsWithTag("Empty")[(Random.Range(0, GameObject.FindGameObjectsWithTag("Empty").Length))].GetComponent <SpriteRenderer> ();
                Temp.sprite = O;
                Temp.tag    = "O";
                Temp.GetComponent <Collider2D> ().enabled = false;
                stat = StatusOfGame.Wait;
            }
        }
    }
 void Awake()
 {
     spriteRenderer = this.gameObject.GetComponent <SpriteRenderer> ();
     stat           = StatusOfGame.ChuseSide;
     XO             = PlyerSide.None;
 }
Пример #7
0
 public void AddCoins()
 {
     _coins += 1;
     StatusOfGame.AddCoin();
     UpdateCoins();
 }