我正在制作项目的俄罗斯方块克隆。我已经完成了很多工作,但我的清晰线条类有一个我无法动摇的bug。我制作了一个10 * 20的网格,我将这些精灵绘制成了。当我在地板上看到一条线时,它可以正常工作,但在此之上,它只会删除线并将其下移。这是我的清线类的代码:俄罗斯方块明确行问题
public static void ClearLines()
{
for (int CountY = Game1.LandedBlocks.GetLength(1) - 1; CountY >= 0; CountY--)
{
bool clearLine = true;
for (int CountX = 0; CountX < Game1.LandedBlocks.GetLength(0); CountX++)
{
clearLine &= Game1.LandedBlocks[CountX, CountY] != -1;
}
if (clearLine)
{
for (int CountX = 0; CountX < Game1.LandedBlocks.GetLength(0); CountX++)
{
Game1.LandedBlocks[CountX, CountY] = -1;
}
for (int y = Game1.LandedBlocks.GetLength(1) - 1; y > 0; y--)
{
for (int CountX = 0; CountX < Game1.LandedBlocks.GetLength(0); CountX++)
{
Game1.LandedBlocks[CountX, y] = Game1.LandedBlocks[CountX, y - 1];
}
}
CountY++;
Game1.rows++;
Game1.score += 100;
}
}
}
如果任何人都可以阐明怎么做我会很感激它。我试过这么多,没有什么工作:(
关于该类格式遗憾。当我看着被格式化post – user1250838 2012-04-13 16:00:32
我刚刚整理出来,只需要等待批准 – ridecar2 2012-04-13 16:01:34
我刚刚编辑过,所以希望不久就会好起来的。 – 2012-04-13 16:01:37