示例#1
0
 // Reset method which is called after a new game is started
 public void Reset()
 {
     // clear the grid and put the blocksplaced and score to 0
     grid.Clear();
     blocksplaced       = 0;
     Score.currentscore = 0;
 }
示例#2
0
 //check if death row contains values other than zero, ifso Game over
 public void CheckIfGameOver()
 {
     for (int i = 1; i < TetrisGrid.GridWidth + 1; i++)
     {
         if (TetrisGrid.Grid[i, 0] != 0)
         {
             //TetrisGame.GameState.Playing = TetrisGame.GameState.GameOver;
             state = true;
             grid.Clear();
         }
     }
 }
示例#3
0
    public void Stop()
    {
        grid.Clear();
        well.RemoveAllBlocks();
        preview.RemoveAllBlocks();

        tickDuration    = _tickDuration;
        tickElapsed     = score = linesRemoved = level = 0;
        scoreText.value = score.ToString().PadLeft(7, '0');

        backgroundMusicInstance.Stop();
    }
示例#4
0
 private void GameStart()
 {
     grid.Clear();
     TetrisGame.gameWorld.activeBlock = null;
     TetrisGame.gameWorld.queuedBlock = null;
     NewBlock();
     activeBlock = queuedBlock;
     NewBlock();
     score = 0;
     level = 1;
     ResetBlockTimer();
     gameState = GameState.Playing;
 }
示例#5
0
 // Zet de game terug naar de begin staat.
 public void Reset()
 {
     gameState = GameState.Init;
     grid.Clear();
     score    = 0;
     rowsToGo = 20;
     level    = 1;
     if (gameType == GameType.Normal)
     {
         dropSpeed = 1000;
     }
     else
     {
         dropSpeed = 600;
     }
 }
示例#6
0
 public void Reset()
 {
     grid.Clear();
 }