示例#1
0
 void Start()
 {
     previousCol = column;
     previuseRow = row;
     board       = FindObjectOfType <BoardCtrl>();
     findMatches = FindObjectOfType <FindMatchesCtrl>();
 }
示例#2
0
        private void ExtraInitializeComponent()
        {
            _boardCtrl      = new BoardCtrl();
            _indicatorCtrl  = new IndicatorCtrl();
            _timerLabel     = new Label();
            _ballCountLabel = new Label();
            _undoLabel      = new Label {
                Text = @"Undo", Enabled = false
            };
            _undoLabel.Click += undoLabel_Click;
            _enableUndo       = false;

            var workingArea  = Screen.PrimaryScreen.WorkingArea;
            var minDimension = workingArea.Height < workingArea.Width ? workingArea.Height : workingArea.Width;

            _indicatorCtrl.Location = new Point(0, 0);
            _indicatorCtrl.Height   = minDimension * 5 / 100; // 5% of min. dimension

            _boardCtrl.Location   = new Point(0, _indicatorCtrl.Height);
            _boardCtrl.CellClick += boardCtrl_CellClick;
            _boardCtrl.BallClick += boardCtrl_BallClick;

            Controls.Add(_indicatorCtrl);
            Controls.Add(_boardCtrl);
            Controls.Add(_timerLabel);
            Controls.Add(_ballCountLabel);
            Controls.Add(_undoLabel);
        }
示例#3
0
 // Start is called before the first frame update
 void Awake()
 {
     enemyDeck   = new List <GameObject>();
     board       = FindObjectOfType <BoardCtrl>();
     isEnemyTurn = false;
     deckPos     = new Vector3(10.0f, 10.0f, 2.0f);
 }
示例#4
0
 // Start is called before the first frame update
 void Awake()
 {
     playerDeck   = new List <GameObject>();
     board        = FindObjectOfType <BoardCtrl>();
     isPlayerTurn = false;
     deckPos      = new Vector3(-10.0f, -10.0f, 2.0f);
     leftDown     = rightDown = false;
 }
示例#5
0
 // Start is called before the first frame update
 void Start()
 {
     spriteRenderer = GetComponent <SpriteRenderer>();
     player         = FindObjectOfType <PlayerCtrl>();
     enemy          = FindObjectOfType <EnemyCtrl>();
     board          = FindObjectOfType <BoardCtrl>();
     m_Owner        = CARD_OWNER.DECK;
     //m_Type = CARD_TYPE.NONE;
     //m_Number = m_Damage = 0;
 }
示例#6
0
        private void boardCtrl_CellClick(BoardCtrl ctrl, Point cell)
        {
            var ball = _game.Board.GetSelectedBall();

            if ((ball == null) || (!_game.LockBoard()))
            {
                return;
            }
            // Move ball
            if (!_game.MoveTo(cell))
            {
                // Wasn't able to move
                _game.UnlockBoard();
            }
        }
示例#7
0
 // Start is called before the first frame update
 void Awake()
 {
     instance = this;
     pv       = photonView;
 }
示例#8
0
 private void boardCtrl_BallClick(BoardCtrl ctrl, BallCtrl ballCtrl)
 {
     _game.Board.SelectBall(ballCtrl.Ball);
 }
示例#9
0
 // Use this for initialization
 void Start()
 {
     board = FindObjectOfType <BoardCtrl>();
 }