public void ReceiveInput(Shape.Direction direction) { if (isTutorialInProgress) { tutorialScript.ReceiveInput(direction); } if (!isGameInProgress || isRotationInProgress) { return; } switch (direction) { case Shape.Direction.NONE: return; case Shape.Direction.SPEEDDOWN: break; case Shape.Direction.SPEEDUP: SpeedUp(); break; default: RotateShape(direction); break; } }
public void RotateShape(Shape.Direction direction) { isRotationInProgress = true; currentShape.Rotate(direction); cubeVisualizer.ApplyShapeRotation(direction); cubeVisualizer.DisplayCollisionIndicator(currentShape.GetHeightMap()); graphicsManager.RecolorShape(cubeVisualizer.ShapeVisuals); timeRemainingUntilCollision = cubeVisualizer.calculateTimeUntilCollision(); soundManager.PlayRotateAudio(); }
public void ReceiveInput(Shape.Direction direction) { if (direction == tutorialStages[currentStage].directionToProgress) { currentStage++; if (currentStage == 5) { gameMaster.OnTutorialFinished(); tutorialUi.SetActive(false); } else { gameMaster.RotateShape(direction); touchAnimatior.Play(tutorialStages[currentStage].animationName); } } }
public void ApplyShapeRotation(Shape.Direction direction) { switch (direction) { case Shape.Direction.UP: StartCoroutine(AnimateRotation(shapeVisuals.transform, 90, false, rotationLength, OnRotationEnded)); break; case Shape.Direction.DOWN: StartCoroutine(AnimateRotation(shapeVisuals.transform, -90, false, rotationLength, OnRotationEnded)); break; case Shape.Direction.LEFT: StartCoroutine(AnimateRotation(shapeVisuals.transform, 90, true, rotationLength, OnRotationEnded)); StartCoroutine(AnimateRotation(cameraOrieantator.transform, 90, true, rotationLength, OnRotationEnded)); break; case Shape.Direction.RIGHT: StartCoroutine(AnimateRotation(shapeVisuals.transform, -90, true, rotationLength, OnRotationEnded)); StartCoroutine(AnimateRotation(cameraOrieantator.transform, -90, true, rotationLength, OnRotationEnded)); break; } }