Exemplo n.º 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;
            }
        }
    }
Exemplo n.º 2
0
    public void GameOver(TetrominoHandler tetromino)
    {
        Debug.Log("Game is Over! your score is " + score);


        Destroy(tetrominoContainer.gameObject);
    }
    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);
    }
Exemplo n.º 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);
 }
Exemplo n.º 5
0
 public void GameOver(TetrominoHandler tetromino)
 {
     gameOver.gameObject.SetActive(true);
     Destroy(tetrominoContainer.gameObject);
     tetromino.Restart();
 }
Exemplo n.º 6
0
 public void GameOver(TetrominoHandler tetromino)
 {
     Debug.Log("Game Over, Your Score is " + score);
     enabled = false;
     Destroy(tetrominoContainer.gameObject);
 }
Exemplo n.º 7
0
    public void GameOver(TetrominoHandler tetromino)
    {
        Debug.Log("NOOB!! Sholat sek kono. Cupu mek oleh sakmene " + score);

        Destroy(tetrominoContainer.gameObject);
    }
Exemplo n.º 8
0
 public void GameOver(TetrominoHandler tetromino)
 {
     Debug.Log("Game is over! Your Score is " + score);
     enabled = false;
 }