Exemplo n.º 1
0
 private void HoldTetrimino()
 {
     if (Input.GetKeyDown(KeyCode.H))
     {
         CurrentTetrimino.Hold();
     }
 }
Exemplo n.º 2
0
 /// <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));
     }
 }
Exemplo n.º 3
0
 /// <summary>
 /// Instant movement on the Y axis.
 /// </summary>
 private void HardDropTetrimino()
 {
     if (Input.GetKeyDown(KeyCode.W))
     {
         canAct = false;
         CurrentTetrimino.HardDrop(Vector3.down);
         canAct = true;
     }
 }
Exemplo n.º 4
0
 /// <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));
     }
 }
Exemplo n.º 5
0
 /// <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));
     }
 }