コード例 #1
0
ファイル: Game1.cs プロジェクト: Sweetwater/TetrisXNA
        private void SetNextTetrimino()
        {
            if (nextTetrimino == null) nextTetrimino = CreateTetrimino(-1);

            tetrimino = nextTetrimino;
            tetrimino.Position = tetriminoStartPosition;
            controller.Tetrimino = tetrimino;

            tetrimino.Update();
            if (CheckBlockCollision(tetrimino.Blocks)) {
                state = State.Dead;
                foreach (Block block in blocks)
                {
                    VanishBlock vanishBlock = new VanishBlock(this, block.Model);
                    vanishBlock.Position = block.Position;
                    vanishBlocks.Add(vanishBlock);
                }
            }

            nextTetrimino = CreateTetrimino(-1);
            nextTetrimino.Position = nextTetriminoPosition;
        }
コード例 #2
0
ファイル: Game1.cs プロジェクト: Sweetwater/TetrisXNA
 private void Reset()
 {
     nextTetrimino = null;
     tetrimino = null;
     blocks.Clear();
     vanishBlocks.Clear();
     SetNextTetrimino();
     state = State.Play;
 }