Beispiel #1
0
 // Update is called once per frame
 void Update()
 {
     if (!gameOver && !pauseMenu.paused && !matchAnimating)
     {
         movePiece();
     }
     if (matchAnimating)
     {
         matchesFound();
     }
     if (levelMaker.isGridClear(grid, columns, rows))
     {
         levelMaker.generatePieces(7, grid, columns, rows);
     }
 }
Beispiel #2
0
 // Use this for initialization
 void Start()
 {
     levelMaker = GameObject.FindGameObjectWithTag("GameManager").GetComponent <LevelMaker>();
     grid       = new GameObject[columns, rows];
     grid       = levelMaker.generatePieces(7, grid, columns, rows);
     GenerateNextPiece();
     SpawnNextPiece();
     moveDownTimer  = Time.time + normalMovDowneRate;
     debug          = GetComponent <Debug>();
     pauseMenu      = GameObject.FindGameObjectWithTag("GameManager").GetComponent <PauseMenu>();
     gameOverScreen = GameObject.FindGameObjectWithTag("GameOverMenu");
     gameOverScore  = GameObject.FindGameObjectWithTag("GameOverScore").GetComponent <Text>();
     gameOverScreen.SetActive(false);
     LastMatches = new List <GameObject>();
 }