예제 #1
0
파일: Arena.cs 프로젝트: aeren108/tetris
        public void Update(GameTime gameTime)
        {
            curTetromino.Update(gameTime);

            if (curTetromino.isLanded)
            {
                SaveTetromino(curTetromino);

                if (curTetromino.GetMinPosition(curTetromino.positions).Y <= 0)
                {
                    //GameOver();
                }
                else
                {
                    Console.WriteLine(curTetromino.GetMinPosition(curTetromino.positions).Y + " : Y pos");

                    curTetromino = new Tetromino(this);
                    curTetromino.LoadContent();
                }
            }

            int rowsFilled = 0;

            //Check if any row is filled
            for (int i = 0; i < height; i++)
            {
                bool isFilled = true;
                for (int j = 0; j < width; j++)
                {
                    if (arena[j, i] == 8)
                    {
                        isFilled = false;
                    }
                }

                if (isFilled)
                {
                    DeleteRow(i);
                    rowsFilled++;
                }
            }

            if (rowsFilled != 0)
            {
                score += rowsFilled * (rowsFilled * 5 + 50);
            }
        }
예제 #2
0
파일: Arena.cs 프로젝트: aeren108/tetris
 public void LoadContent()
 {
     arenaTexture = Assets.TETRIS_ARENA;
     font         = Assets.SCORE_FONT;
     curTetromino.LoadContent();
 }