示例#1
0
文件: Game.cs 项目: Egor454/Tetris
 void PlayerMovement()
 {
     if (Input.GetKeyUp(downButton) || Input.GetKeyUp(rightButton) || Input.GetKeyUp(leftButton))
     {
         tetromino.CheckUserInput();
     }
     if (Input.GetKey(downButton) || Time.time - fall >= fallSpeed)
     {
         tetromino.VerticalMovement(nextTetromino);
     }
     else if (Input.GetKeyDown(rotateButton))
     {
         tetromino.Rotation(nextTetromino);
     }
     else if (Input.GetKey(leftButton))
     {
         tetromino.LeftMovement(nextTetromino);
     }
     else if (Input.GetKey(rightButton))
     {
         tetromino.RightMovement(nextTetromino);
     }
 }