Ejemplo n.º 1
0
        private void DrawEmptyRow(int row)
        {
            IGameFieldView field = _game.GameField;

            for (int column = field.Width - 1; column >= 0; column--)
            {
                DrawPoint(_gameFieldLeft + column * POINT_WIDTH, _gameFieldTop + row * POINT_HEIGHT, EMPTY_COLOR);
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="gameFieldView">
 /// Представление игрового поля.
 /// </param>
 /// <param name="coliseController">
 /// Котроллер для расчета колизий.
 /// </param>
 /// <param name="gameParams">
 /// Параметры игры
 /// </param>
 public GameController(IGameFieldView gameFieldView,
                       IColiseController coliseController,
                       GameParams gameParams)
 {
     _gameFieldView    = gameFieldView;
     _userSlideView    = _gameFieldView.UserSlideView;
     _coliseController = coliseController;
     _gameParams       = gameParams;
     IsStartGame       = false;
     _curFirstBlock    = 0;
 }
Ejemplo n.º 3
0
        private void DrawRows(int firstRow, int lastRow)
        {
            IGameFieldView field = _game.GameField;

            for (int row = lastRow; row >= firstRow; row--)
            {
                for (int column = field.Width - 1; column >= 0; column--)
                {
                    DrawPoint(_gameFieldLeft + column * POINT_WIDTH, _gameFieldTop + row * POINT_HEIGHT, _shapeColors[field[column, row]]);
                }
            }
        }
Ejemplo n.º 4
0
        private void DrawField()
        {
            IGameFieldView field = _game.GameField;

            DrawBorder(_gameFieldLeft, _gameFieldTop, field.Width * POINT_WIDTH, field.Height * POINT_HEIGHT, _borderColor);

            for (int deltaX = field.Width - 1; deltaX >= 0; deltaX--)
            {
                for (int deltaY = field.Height - 1; deltaY >= 0; deltaY--)
                {
                    DrawPoint(_gameFieldLeft + deltaX * POINT_WIDTH, _gameFieldTop + deltaY * POINT_HEIGHT, _shapeColors[field[deltaX, deltaY]]);
                }
            }
        }