Esempio n. 1
0
    void Start()
    {
        gameRunning = true;

        if (PlayerPrefs.GetString("LastGameModeSelected") == "Easy")
        {
            EasyGameInitialization();
        }
        else
        {
            HardGameInitialization();
        }

        // Set the health to its maximum
        currentHealth = maxHealth;
        healthBar.SetMaxHealth(maxHealth);

        // Create the grid of cards
        CardOrganizer.DisplayCards(originalCard, healthBar, timeLabel, gridRows, gridCols, offsetX, offsetY, numbers, images);

        // Array for references to the cards' backs
        cardsBack = GameObject.FindGameObjectsWithTag("CardBack");

        // Show all cards by disabling all the cards' backs
        foreach (GameObject c in cardsBack)
        {
            c.SetActive(false);
        }

        // Cover all cards after 2s and starts the timer
        Invoke("CoverAllCards", 2.0f);
    }
Esempio n. 2
0
        // Use this for initialization
        void Start()
        {
            var deck = new DeckFactory(new MBCardFactory(CardPrefab, false)).GetTensDeck(new List <int> {
                0, 1, 2
            });
            var hands = new List <List <ICard> >();

            for (int i = 0; i < 4; i++)
            {
                var thisHand = new List <ICard>();
                while (thisHand.Count < 10)
                {
                    thisHand.Add(deck.PopCard());
                }
                hands.Add(thisHand);
            }
            var organizer = new CardOrganizer(IsMine, 1, HandWidth, HandDistance, HandTilt);

            for (int i = 0; i < 4; i++)
            {
                organizer.OrganizeHandCards(hands[i], (Position)i);
            }
        }