private void HoldTetrimino() { if (Input.GetKeyDown(KeyCode.H)) { CurrentTetrimino.Hold(); } }
/// <summary> /// Movement on the Y axis. /// </summary> private void DropTetrimino() { if (!delayGroup.ContainsKey(KeyCode.S) && Input.GetKey(KeyCode.S)) { CurrentTetrimino.Move(Vector3.down); StartCoroutine(InputDelay(KeyCode.S)); } }
/// <summary> /// Instant movement on the Y axis. /// </summary> private void HardDropTetrimino() { if (Input.GetKeyDown(KeyCode.W)) { canAct = false; CurrentTetrimino.HardDrop(Vector3.down); canAct = true; } }
/// <summary> /// Rotation of the tetrimino. /// </summary> private void RotateTetrimino() { if (Input.GetKeyDown(KeyCode.J)) { CurrentTetrimino.Rotate(new Vector3(0, 0, -90f)); } else if (Input.GetKeyDown(KeyCode.I)) { CurrentTetrimino.Rotate(new Vector3(0, 0, 90f)); } }
/// <summary> /// Movement on the X axis. /// </summary> private void MoveTetrimino() { if (!delayGroup.ContainsKey(KeyCode.A) && Input.GetKey(KeyCode.A)) { CurrentTetrimino.Move(Vector3.left); StartCoroutine(InputDelay(KeyCode.A)); } else if (!delayGroup.ContainsKey(KeyCode.D) && Input.GetKey(KeyCode.D)) { CurrentTetrimino.Move(Vector3.right); StartCoroutine(InputDelay(KeyCode.D)); } }