コード例 #1
0
    public void UpdateGrid(TetrominoHandler tetromino)
    {
        for (int y = 0; y < gridHeight; y++)
        {
            for (int x = 0; x < gridWidth; x++)
            {
                if (grid[x, y] != null)
                {
                    if (grid[x, y].parent == tetromino.transform)
                    {
                        grid[x, y] = null;
                    }
                }
            }
        }

        foreach (Transform mino in tetromino.transform)
        {
            Vector3 pos = Round(mino.position);
            if (pos.y < gridHeight)
            {
                grid[(int)pos.x, (int)pos.y] = mino;
            }
        }
    }
コード例 #2
0
    public void GameOver(TetrominoHandler tetromino)
    {
        Debug.Log("Game is Over! your score is " + score);


        Destroy(tetrominoContainer.gameObject);
    }
コード例 #3
0
    public void GameOver(TetrominoHandler tetromino)
    {
        Debug.Log("Game is Over! Your score is " + score);
        panelGameover.SetActive(true);
        txtGameover.text = "Your score is : " + score;
        if (score > PlayerPrefs.GetInt("highscore"))
        {
            highscore = score;
            PlayerPrefs.SetInt("highscore", highscore);
            txtHighscore.text = "" + highscore;
        }

        Destroy(tetrominoContainer.gameObject);
    }
コード例 #4
0
 public bool IsReactLimitGrid(TetrominoHandler tetromino)
 {
     for (int x = 0; x < gridWidth; x++)
     {
         foreach (Transform mino in tetromino.transform)
         {
             Vector3 pos = Round(mino.position);
             if (pos.y >= gridHeight - 1 &&
                 !tetromino.isActiveAndEnabled)
             {
                 return(true);
             }
         }
     }
     return(false);
 }
コード例 #5
0
 public void GameOver(TetrominoHandler tetromino)
 {
     gameOver.gameObject.SetActive(true);
     Destroy(tetrominoContainer.gameObject);
     tetromino.Restart();
 }
コード例 #6
0
 public void GameOver(TetrominoHandler tetromino)
 {
     Debug.Log("Game Over, Your Score is " + score);
     enabled = false;
     Destroy(tetrominoContainer.gameObject);
 }
コード例 #7
0
    public void GameOver(TetrominoHandler tetromino)
    {
        Debug.Log("NOOB!! Sholat sek kono. Cupu mek oleh sakmene " + score);

        Destroy(tetrominoContainer.gameObject);
    }
コード例 #8
0
 public void GameOver(TetrominoHandler tetromino)
 {
     Debug.Log("Game is over! Your Score is " + score);
     enabled = false;
 }