コード例 #1
0
ファイル: Game.cs プロジェクト: apetzak/Tetris
        public int GetSpaceBetweenBlocks()
        {
            int spaces = 20;

            foreach (Block b in Shape.GetBottomBlocks())
            {
                foreach (Block _b in Blocks.Where(_b => _b.X == b.X))
                {
                    if (b.Y - _b.Y < spaces && b.Y > _b.Y)
                    {
                        spaces = b.Y - _b.Y;
                    }
                }
            }
            return(spaces - 1); // return amount of space between bottom blocks and resting blocks
        }