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