Пример #1
0
        //Initializes the player variables
        public void init(bool player1)
        {
            // get protocolManager from GameManager
            protocols = GameManager.protocols;

            deck        = new ArrayList();
            hand        = new ArrayList();
            GraveYard   = new ArrayList();
            cardsInPlay = new ArrayList();
            treeID      = new ArrayList();

            //Set's player's coordinates of interest for p1 and p2
            setPlayerNum(player1);

            //Creates the player's tree and mana displayer
            createTree();
            createMana();
        }
Пример #2
0
        void Start()
        {
            // Needed to to fade into scene
            Game.StartEnterTransition();
            showLoading = 300;             //5 seconds
            popup       = GameObject.Find("Loading");
            protocols   = (ProtocolManager)gameObject.AddComponent <ProtocolManager>();
            protocols.init();

            enabled = true;
            player1 = (BattlePlayer)gameObject.AddComponent <BattlePlayer>();
            player1.init(true);
            player1.playerID = GameState.player.GetID();
            Debug.Log("player1 ID : " + player1.playerID);
            player1.playerName = GameState.player.GetName();

            // initialize match here

            if (Constants.SINGLE_PLAYER)
            {
                player2 = (BattlePlayer)gameObject.AddComponent <BattlePlayer>();
                player2.init(false);
                player2.playerName = "Player 2";
            }
            else
            {
                // TODO: Need different logic here to make player 2
                // not have cards dealt face up, etx.
                player2 = (BattlePlayer)gameObject.AddComponent <BattlePlayer>();
                player2.init(false);
                player2.playerName = "Player 2";
            }
            // Send MatchStatus protocol
            initMatch();

            curPlayer           = player1;
            GameManager.manager = this;

            // Poll for turn updates
            //StartCoroutine(PollAction(Constants.UPDATE_RATE));
        }