void Update() { if (Input.GetKeyDown(KeyCode.LeftArrow)) { fullGrid = BoardControlls.moveInXDirection(fullGrid, -1); } if (Input.GetKeyDown(KeyCode.RightArrow)) { fullGrid = BoardControlls.moveInXDirection(fullGrid, 1); } bgCreator.render(getGameGrid()); }
private void moveBoardDown() { List <int[]> moveIndexes = BoardControlls.getMovingPos(fullGrid); if (BoardControlls.canMove(fullGrid, 0, 1) == false) { stopMoving(); spawnNewPice(); return; } for (int y = fullGrid.GetLength(1); y >= 0; y--) { foreach (int[] m in moveIndexes) { if (m [1] == y) { fullGrid[m[0], m[1]] = (int)SqaureState.Empty; fullGrid [m [0], m [1] + 1] = (int)SqaureState.Moving; } } } }